Commit 529e50de authored by seoyeon's avatar seoyeon
Browse files

0802

parent b00d28ed
import ScreenSelect from './ScreenSelect' import ScreenSelect from './ScreenSelect'
import video_btn from '../../videobtn.png'
import speaker_btn from '../../speakerbtn.png'
import mic_btn from '../../micbtn.png'
import videooff_btn from '../../videooffbtn.png'
import speakeroff_btn from '../../speakeroffbtn.png'
import micoff_btn from '../../micoffbtn.png'
import React, { useState } from 'react'; import React, { useState } from 'react';
const Controller = () => { const Controller = () => {
...@@ -29,22 +23,22 @@ const Controller = () => { ...@@ -29,22 +23,22 @@ const Controller = () => {
{mic ? <div className="col d-flex justify-content-center"> {mic ? <div className="col d-flex justify-content-center">
<button type="button" className="btn" onClick={micOn}> <button type="button" className="btn" onClick={micOn}>
<img src={micoff_btn} width="45" height="40" /> <img src="/micoffbtn.png" width="45" height="40" />
</button> </button>
</div> </div>
: <div className="col d-flex justify-content-center"> : <div className="col d-flex justify-content-center">
<button type="button" className="btn" onClick={micOff}> <button type="button" className="btn" onClick={micOff}>
<img src={mic_btn} width="45" height="40" /> <img src="/micbtn.png" width="45" height="40" />
</button> </button>
</div> </div>
} }
{speaker ? <div className="col d-flex justify-content-center"> {speaker ? <div className="col d-flex justify-content-center">
<button type="button" className="btn" onClick={speakerOn}> <button type="button" className="btn" onClick={speakerOn}>
<img src={speakeroff_btn} width="45" /> <img src="/speakeroffbtn.png" width="45" />
</button> </button>
</div> : <div className="col d-flex justify-content-center"> </div> : <div className="col d-flex justify-content-center">
<button type="button" className="btn" onClick={speakerOff}> <button type="button" className="btn" onClick={speakerOff}>
<img src={speaker_btn} width="45" /> <img src="/speakerbtn.png" width="45" />
</button> </button>
</div> </div>
} }
...@@ -57,12 +51,12 @@ const Controller = () => { ...@@ -57,12 +51,12 @@ const Controller = () => {
onClick="location.href='ScreenSelect.js'" onClick="location.href='ScreenSelect.js'"
onClick={videoOn} onClick={videoOn}
> >
<img src={videooff_btn} width="45" /> <img src="/videooffbtn.png" width="45" />
</button> </button>
</div> : </div> :
<div className="col d-flex justify-content-center"> <div className="col d-flex justify-content-center">
<button type="button" className="btn" onClick={videoOff}> <button type="button" className="btn" onClick={videoOff}>
<img src={video_btn} width="45" /> <img src="/videobtn.png" width="45" />
</button> </button>
</div>} </div>}
</div> </div>
......
import backward from "../../backward.png";
import ChannelSingle from "./ChannelSingle"; import ChannelSingle from "./ChannelSingle";
const LeftHamberger = () => { const LeftHamberger = () => {
......
...@@ -2,12 +2,10 @@ import axios from "axios"; ...@@ -2,12 +2,10 @@ import axios from "axios";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Redirect } from "react-router-dom"; import { Redirect } from "react-router-dom";
import userApi from "../apis/user.api"; import userApi from "../apis/user.api";
// import catchErrors from "../context/catchError"; import catchErrors from "../context/catchError";
// import auth from "../context/auth_context"
const INIT_USER = { const INIT_USER = {
name: "", name: "",
idNumber1: "",
idNumber2: "",
email: "", email: "",
password: "", password: "",
checkpw: "", checkpw: "",
...@@ -25,8 +23,6 @@ const Signup = () => { ...@@ -25,8 +23,6 @@ const Signup = () => {
setDisabled( setDisabled(
!( !(
user.name && user.name &&
user.idNumber1 &&
user.idNumber2 &&
user.email && user.email &&
user.password && user.password &&
user.checkpw user.checkpw
...@@ -41,31 +37,30 @@ const Signup = () => { ...@@ -41,31 +37,30 @@ const Signup = () => {
} }
async function handleSubmit() { async function handleSubmit() {
console.log('회원가입')
try { try {
const data = await userApi.signup(user) const data = await userApi.signup(user)
// const data = await axios.post("https://localhost:8080/api/room/1/1",user)
setLoading(true); setLoading(true);
setError(""); setError("");
// const success = await login(user.email, user.password); // const success = await login(user.email, user.password);
// const data = await axios.post("/api/room/1/1",user)
console.log(data); console.log(data);
setSuccess(true); setSuccess(true);
} catch (error) { } catch (error) {
// catchErrors(error, setError); catchErrors(error, setError);
} finally { } finally {
setLoading(false); setLoading(false);
} }
} }
if (success) { if (success) {
alert('회원가입 되었습니다.') alert('회원가입 되었습니다.')
return <Redirect to="/" />; return <Redirect to="/" />;
} }
const { name, idNumber1, idNumber2, id, password, checkpw, phone } = user; const { name, id, password, checkpw, phone } = user;
return ( return (
<div className="modal-content"> <div className="modal-content">
{error && <div className="alert alert-danger">{error}</div>}
<form onSubmit={handleSubmit}> <form onSubmit={handleSubmit}>
<div className="modal-header"> <div className="modal-header">
<h5 className="modal-title" id="loginModalLabel"> <h5 className="modal-title" id="loginModalLabel">
...@@ -91,38 +86,6 @@ const Signup = () => { ...@@ -91,38 +86,6 @@ const Signup = () => {
onChange={handleChange} onChange={handleChange}
/> />
</div> </div>
<div className="p-2">
<label className="p-1">주민등록번호</label>
<div className="d-flex text-center">
<div className="col-4">
<input
className="mt-2 form-control"
id="idNumber1"
type="text"
name="idNumber1"
placeholder="●●●●●●"
maxLength='6'
value={idNumber1}
onChange={handleChange}
/>
</div>
<div className="col-1 pt-3 ps-2"></div>
<div className="col-1">
<input
className="mt-2 ms-2 form-control"
id="idNumber2"
type="text"
style={{width:'35px'}}
name="idNumber2"
placeholder=""
value={idNumber2}
onChange={handleChange}
maxLength='1'
/>
</div>
<div className="pt-3 ps-4">* * * * * *</div>
</div>
</div>
<div className="p-2"> <div className="p-2">
<label className="p-1">아이디</label> <label className="p-1">아이디</label>
<input <input
...@@ -160,7 +123,7 @@ const Signup = () => { ...@@ -160,7 +123,7 @@ const Signup = () => {
/> />
</div> </div>
<div className="p-2"> <div className="p-2">
<label className="p-1">전화번호(선택)</label> <label className="p-1">전화번호</label>
<input <input
className="form-control" className="form-control"
id="phone" id="phone"
......
...@@ -85,8 +85,8 @@ const signup = async (req, res) => { ...@@ -85,8 +85,8 @@ const signup = async (req, res) => {
if (user) if (user)
return res.status(422).send(`${email} 이미 존재하는 사용자입니다.`); return res.status(422).send(`${email} 이미 존재하는 사용자입니다.`);
if (!isLength(name, { min: 3, max: 10 })) { if (!isLength(name, { min: 2, max: 10 })) {
return res.status(422).send("이름은 3-10자 사이입니다"); return res.status(422).send("이름은 2-10자 사이입니다");
} else if (!isLength(password, { min: 6 })) { } else if (!isLength(password, { min: 6 })) {
return res.status(422).send("비밀번호는 6자이상 입니다"); return res.status(422).send("비밀번호는 6자이상 입니다");
} else if (!isLength(email, { min: 3, max: 10 })) { } else if (!isLength(email, { min: 3, max: 10 })) {
...@@ -97,7 +97,6 @@ const signup = async (req, res) => { ...@@ -97,7 +97,6 @@ const signup = async (req, res) => {
name: name, name: name,
email: email, email: email,
password: password, password: password,
gender: gender,
phone: phone, phone: phone,
}) })
} catch (error) { } catch (error) {
......
...@@ -19,9 +19,6 @@ const UserModel = (sequelize) => { ...@@ -19,9 +19,6 @@ const UserModel = (sequelize) => {
password: { password: {
type: DataTypes.STRING, type: DataTypes.STRING,
}, },
gender: {
type: DataTypes.INTEGER,
},
phone: { phone: {
type: DataTypes.STRING, type: DataTypes.STRING,
}, },
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment