Commit 6903b3c1 authored by seoyeon's avatar seoyeon
Browse files

Merge remote-tracking branch 'origin/jaeyeoniiiiii' into seoyeon2

parents 744660e7 16fe890c
...@@ -16,7 +16,19 @@ function App() { ...@@ -16,7 +16,19 @@ function App() {
<Route exact path="/user" component={HomeUserPage} /> <Route exact path="/user" component={HomeUserPage} />
<Route path="/profile/:id/update" component={InfoUpdatePage} /> <Route path="/profile/:id/update" component={InfoUpdatePage} />
<Route path="/profile/:id" component={ProfilePage} /> <Route path="/profile/:id" component={ProfilePage} />
<Route path="/room/:roomId/:channelId" component={RoomPage} /> <Route path="/room/:roomId/:channelId" component={RoomPage}>
{/* <Switch>
<Route path={"/room/:roomId/meeting"}>
<></>
</Route>
<Route path={"/room/:roomId/normal"}>
<></>
</Route>
<Route path={"/room/:roomId/notice"}>
<></>
</Route>
</Switch> */}
</Route>
<Route path="/room/Invite" component={InvitePage} /> <Route path="/room/Invite" component={InvitePage} />
</Switch> </Switch>
{/* </AuthProvider> */} {/* </AuthProvider> */}
......
import axios from "axios"; import axios from "axios";
const getUser = async (id) => { const getUser = async (id) => {
// console.log('id222:',id.userID)
const { data } = await axios.get(`/api/getUser/${id}`); const { data } = await axios.get(`/api/getUser/${id}`);
return data; return data;
}; };
......
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Redirect } from "react-router-dom"; import { Redirect, useParams } from "react-router-dom";
import roomApi from "../../apis/room.api"; import roomApi from "../../apis/room.api";
import catchErrors from "../../context/catchError"; import catchErrors from "../../context/catchError";
...@@ -45,7 +45,7 @@ const CreateRoom = () => { ...@@ -45,7 +45,7 @@ const CreateRoom = () => {
if (success) { if (success) {
console.log('success', success) console.log('success', success)
alert('룸생성이 완료되었습니다!') alert('룸생성이 완료되었습니다!')
return <Redirect to='/user' /> return <Redirect to="/user"/>
} }
const { name, owner, member, profileimg } = room; const { name, owner, member, profileimg } = room;
......
...@@ -8,15 +8,13 @@ const RoomSingle = () => { ...@@ -8,15 +8,13 @@ const RoomSingle = () => {
const [room, setRoom] = useState([]) const [room, setRoom] = useState([])
const id = localStorage.getItem('user'); const id = localStorage.getItem('user');
const channelId = 1 const channelId = 1
const A = []
// async function getJoinRoom(Id) { // async function getJoinRoom(Id) {
// try { // try {
// console.log('id:',id) // const user = await userApi.getUser({id: Id})
// const User = await userApi.getUser({id: Id}) // console.log('User1:',user)
// console.log('User1:',User) // console.log('User2:',user.roomNumber)
// console.log('User2:',User.roomNumber) // const RoomNumArr = user.roomNumber
// const RoomNumArr = User.roomNumber
// console.log('setRoomNum:',RoomNumArr) // console.log('setRoomNum:',RoomNumArr)
// const Room = await roomApi.getRoom(RoomNumArr) // const Room = await roomApi.getRoom(RoomNumArr)
// } catch (error) { // } catch (error) {
......
import { Link, Route, Switch, useParams } from "react-router-dom";
const ChannelSingle = () => { const ChannelSingle = () => {
const { roomId } = useParams();
return ( return (
<div className="overflow-auto" style={{ height: '610px' }}> <div className="overflow-auto" style={{ height: "610px" }}>
<div className="mb-3"> <div className="mb-3">
<div className="m-3 p-1 row" style={{ backgroundColor: '#E0CEE8' }}> <div className="m-3 p-1 row" style={{ backgroundColor: "#E0CEE8" }}>
<Link to={`${roomId}/meeting`}>
<img <img
className="col-auto mt-2" className="col-auto mt-2"
src="/fullSpeaker.png" src="/fullSpeaker.png"
width="25px" width="25px"
height="25px" height="25px"
/> />
<h5 className="col mt-2">회의</h5> <h5 className="col mt-2" style={{ color: "black" }}>
</div> 회의
<ul className="mx-5" style={{ color: '#76D079' }}> </h5>
<li> </Link>
<p style={{ color: 'black' }}>CHERRY</p>
</li>
<li>
<p style={{ color: 'black' }}>JAEYEON</p>
</li>
<li>
<p style={{ color: 'black' }}>SEOYEON</p>
</li>
<li>
<p style={{ color: 'black' }}>JIWEON</p>
</li>
<li>
<p style={{ color: 'black' }}>BYOUNGYUN</p>
</li>
</ul>
</div>
<div className="mb-3">
<div className="m-3 p-1 row" style={{ backgroundColor: '#E0CEE8' }}>
<img
className="col-auto mt-2"
src="/emptySpeaker.png"
width="25px"
height="25px"
/>
<h5 className="col mt-2">사담</h5>
</div> </div>
<ul className="mx-5" style={{ color: '#76D079' }}> <ul className="mx-5" style={{ color: "#76D079" }}>
<li> <li>
<p style={{ color: 'black' }}>CHERRY</p> <p style={{ color: "black" }}>CHERRY</p>
</li> </li>
<li> <li>
<p style={{ color: 'black' }}>JAEYEON</p> <p style={{ color: "black" }}>JAEYEON</p>
</li> </li>
<li> <li>
<p style={{ color: 'black' }}>SEOYEON</p> <p style={{ color: "black" }}>SEOYEON</p>
</li> </li>
<li> <li>
<p style={{ color: 'black' }}>JIWEON</p> <p style={{ color: "black" }}>JIWEON</p>
</li> </li>
<li> <li>
<p style={{ color: 'black' }}>BYOUNGYUN</p> <p style={{ color: "black" }}>BYOUNGYUN</p>
</li> </li>
</ul> </ul>
</div> </div>
<div className="mb-3"> <div className="mb-3">
<div className="m-3 p-1 row" style={{ backgroundColor: '#E0CEE8' }}> <div className="m-3 p-1 row" style={{ backgroundColor: "#E0CEE8" }}>
<img <img
className="col-auto mt-2" className="col-auto mt-2"
src="/emptySpeaker.png" src="/emptySpeaker.png"
width="25px" width="25px"
height="25px" height="25px"
/> />
<h5 className="col mt-2">일반</h5> <Link to={`${roomId}/normal`}>
<h5 className="col mt-2" style={{ color: "black" }}>
일반
</h5>
</Link>
</div> </div>
<ul className="mx-5" style={{ color: '#76D079' }}> <ul className="mx-5" style={{ color: "#76D079" }}>
<li> <li>
<p style={{ color: 'black' }}>CHERRY</p> <p style={{ color: "black" }}>CHERRY</p>
</li> </li>
<li> <li>
<p style={{ color: 'black' }}>JAEYEON</p> <p style={{ color: "black" }}>JAEYEON</p>
</li> </li>
<li> <li>
<p style={{ color: 'black' }}>SEOYEON</p> <p style={{ color: "black" }}>SEOYEON</p>
</li> </li>
<li> <li>
<p style={{ color: 'black' }}>JIWEON</p> <p style={{ color: "black" }}>JIWEON</p>
</li> </li>
<li> <li>
<p style={{ color: 'black' }}>BYOUNGYUN</p> <p style={{ color: "black" }}>BYOUNGYUN</p>
</li> </li>
</ul> </ul>
</div> </div>
<div className="mb-3"> <div className="mb-3">
<div className="m-3 p-1 row" style={{ backgroundColor: '#E0CEE8' }}> <div className="m-3 p-1 row" style={{ backgroundColor: "#E0CEE8" }}>
<img <img
className="col-auto mt-2" className="col-auto mt-2"
src="/emptySpeaker.png" src="/emptySpeaker.png"
width="25px" width="25px"
height="25px" height="25px"
/> />
<h5 className="col mt-2">공지</h5> <Link to={`${roomId}/notice`}>
<h5 className="col mt-2" style={{ color: "black" }}>
공지
</h5>
</Link>
</div> </div>
<ul className="mx-5" style={{ color: '#76D079' }}> <ul className="mx-5" style={{ color: "#76D079" }}>
<li> <li>
<p style={{ color: 'black' }}>CHERRY</p> <p style={{ color: "black" }}>CHERRY</p>
</li> </li>
<li> <li>
<p style={{ color: 'black' }}>JAEYEON</p> <p style={{ color: "black" }}>JAEYEON</p>
</li> </li>
<li> <li>
<p style={{ color: 'black' }}>SEOYEON</p> <p style={{ color: "black" }}>SEOYEON</p>
</li> </li>
<li> <li>
<p style={{ color: 'black' }}>JIWEON</p> <p style={{ color: "black" }}>JIWEON</p>
</li> </li>
<li> <li>
<p style={{ color: 'black' }}>BYOUNGYUN</p> <p style={{ color: "black" }}>BYOUNGYUN</p>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
) );
} };
export default ChannelSingle export default ChannelSingle;
...@@ -3,7 +3,6 @@ import { useEffect, useState } from "react"; ...@@ -3,7 +3,6 @@ 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";
const INIT_USER = { const INIT_USER = {
name: "", name: "",
email: "", email: "",
...@@ -17,7 +16,6 @@ const Signup = () => { ...@@ -17,7 +16,6 @@ const Signup = () => {
const [error, setError] = useState(""); const [error, setError] = useState("");
const [disabled, setDisabled] = useState(false); const [disabled, setDisabled] = useState(false);
const [success, setSuccess] = useState(false); const [success, setSuccess] = useState(false);
const [loading, setLoading] = useState(false);
useEffect(() => { useEffect(() => {
setDisabled( setDisabled(
...@@ -33,30 +31,38 @@ const Signup = () => { ...@@ -33,30 +31,38 @@ const Signup = () => {
function handleChange(event) { function handleChange(event) {
const { name, value } = event.target; const { name, value } = event.target;
setUser({ ...user, [name]: value }); setUser({ ...user, [name]: value });
// console.log(user);
} }
async function handleSubmit() { async function handleSubmit() {
console.log('회원가입') console.log('회원가입')
try { try {
const data = await userApi.signup(user) const data = await userApi.signup(user);
setLoading(true); console.log(data)
setError("");
// const success = await login(user.email, user.password);
console.log(data);
setSuccess(true); setSuccess(true);
setError("");
} catch (error) { } catch (error) {
catchErrors(error, setError); catchErrors(error, setError);
} finally { } finally {
setLoading(false); // setLoading(false);
}
}
function checkPassword(event) {
const p1 = user.password;
const p2 = user.checkpw;
if (p1 !== p2) {
event.preventDefault();
alert("비밀번호가 일치하지 않습니다.");
return false;
} else {
setSuccess(true);
return true;
} }
} }
if (success) { if (success) {
alert('회원가입 되었습니다.') alert("회원가입 되었습니다.");
return <Redirect to="/" />; <Redirect to="/" />;
} }
const { name, id, password, checkpw, phone } = user; const { name, id, password, checkpw, phone } = user;
return ( return (
<div className="modal-content"> <div className="modal-content">
...@@ -137,7 +143,12 @@ const Signup = () => { ...@@ -137,7 +143,12 @@ const Signup = () => {
</div> </div>
{console.log(disabled)} {console.log(disabled)}
<div className="modal-footer"> <div className="modal-footer">
<button type="submit" className="btn btn-primary" disabled={disabled}> <button
type="submit"
className="btn btn-primary"
onClick={checkPassword}
disabled={disabled}
>
회원가입 회원가입
</button> </button>
</div> </div>
......
import bcrypt from "bcryptjs"; import bcrypt from "bcryptjs";
import { DataTypes } from "sequelize"; import { DataTypes } from "sequelize";
// import img from 'bora_it\client\public\user.png'
const UserModel = (sequelize) => { const UserModel = (sequelize) => {
const User = sequelize.define( const User = sequelize.define(
...@@ -19,6 +18,9 @@ const UserModel = (sequelize) => { ...@@ -19,6 +18,9 @@ const UserModel = (sequelize) => {
password: { password: {
type: DataTypes.STRING, type: DataTypes.STRING,
}, },
checkpw:{
type: DataTypes.STRING,
},
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