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

0802

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