Commit 5f25610a authored by Choi Ga Young's avatar Choi Ga Young
Browse files

진짜 끝

parent 4c6f4efe
...@@ -13,17 +13,17 @@ function EnterRoom(props) { ...@@ -13,17 +13,17 @@ function EnterRoom(props) {
async function recordEntryLog() { async function recordEntryLog() {
const leaveInfo = { userId: userId, roomCode: enterCode, leaveTime: realTime } const leaveInfo = { userId: userId, roomCode: enterCode, leaveTime: realTime }
try { try {
const check = await axios.get('/room/entrylog', { params: leaveInfo }) const check = await axios.get('/room/entrylog', { params: leaveInfo })
if (check.data) { //있으면 put으로 if (check.data) { //있으면 put으로
await axios.put('/room/entrylog', leaveInfo) await axios.put('/room/entrylog', leaveInfo)
} else { //없으면 post } else { //없으면 post
await axios.post('/room/entrylog', leaveInfo) await axios.post('/room/entrylog', leaveInfo)
} }
} catch (error) { } catch (error) {
catchErrors(error, setError) catchErrors(error, setError)
} }
} }
function handleChange(event) { function handleChange(event) {
const { name, value } = event.target const { name, value } = event.target
...@@ -57,6 +57,9 @@ function EnterRoom(props) { ...@@ -57,6 +57,9 @@ function EnterRoom(props) {
<Modal.Header closeButton> <Modal.Header closeButton>
<Modal.Title>참여 코드로 채팅 참가</Modal.Title> <Modal.Title>참여 코드로 채팅 참가</Modal.Title>
</Modal.Header> </Modal.Header>
{error && <Alert variant='danger'>
{error}
</Alert>}
<Modal.Body> <Modal.Body>
<Form onSubmit={handleSubmit}> <Form onSubmit={handleSubmit}>
<Form.Group as={Row} controlId="formCodeE"> <Form.Group as={Row} controlId="formCodeE">
...@@ -67,7 +70,7 @@ function EnterRoom(props) { ...@@ -67,7 +70,7 @@ function EnterRoom(props) {
</Form.Group> </Form.Group>
<Form.Group as={Row}> <Form.Group as={Row}>
<Col sm={{ span: 5, offset: 4 }}> <Col sm={{ span: 5, offset: 4 }}>
<Button type="submit" style={{backgroundColor:"#9174ad", borderColor:"#9174ad"}} >참가</Button> <Button type="submit" style={{ backgroundColor: "#9174ad", borderColor: "#9174ad" }} >참가</Button>
</Col> </Col>
</Form.Group> </Form.Group>
</Form> </Form>
......
...@@ -54,9 +54,9 @@ function LogIn() { ...@@ -54,9 +54,9 @@ function LogIn() {
return ( return (
<> <>
<Menu /> <Menu />
<Form onSubmit={handleSubmit} className='vh-85 flex-column align-items-center justify-content-center mt-2'> <Form onSubmit={handleSubmit} className="vh-90 flex-column align-items-center justify-content-center mt-2" variant="dark">
<Container className="d-flex justify-content-center"> <div className="d-flex justify-content-center">
<div className="mt-5 p-5 shadow w-75"> <div className="mt-5 p-5 mr-2" style={{ display: "flex", flexDirection: "column", borderStyle: "solid", borderRadius: "5px", borderColor: "#4A5D7E", backgroundColor: "#FFFFFF", padding: '15px', position: "relative" }}>
<h2 className="text-center">로그인</h2> <h2 className="text-center">로그인</h2>
<Form.Group controlId="formGroupEmail"> <Form.Group controlId="formGroupEmail">
<Form.Label>이메일</Form.Label> <Form.Label>이메일</Form.Label>
...@@ -85,7 +85,6 @@ function LogIn() { ...@@ -85,7 +85,6 @@ function LogIn() {
필수 정보입니다! 비밀번호를 입력해주세요! 필수 정보입니다! 비밀번호를 입력해주세요!
</Form.Control.Feedback> </Form.Control.Feedback>
</Form.Group> </Form.Group>
<Button <Button
disabled={disabled || loading} disabled={disabled || loading}
type="submit" type="submit"
...@@ -100,7 +99,7 @@ function LogIn() { ...@@ -100,7 +99,7 @@ function LogIn() {
{error} {error}
</Alert>} </Alert>}
</div> </div>
</Container> </div>
</Form> </Form>
</> </>
); );
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import axios from 'axios' import axios from 'axios'
import { Button, Form, Container, Alert, Spinner} from 'react-bootstrap'; import { Button, Form, Container, Alert, Spinner } from 'react-bootstrap';
import catchErrors from '../utils/catchErrors'; import catchErrors from '../utils/catchErrors';
import { Redirect } from 'react-router-dom'; import { Redirect } from 'react-router-dom';
import Menu from '../Components/Menu'; import Menu from '../Components/Menu';
...@@ -17,7 +17,7 @@ function SingUp() { ...@@ -17,7 +17,7 @@ function SingUp() {
const [user, setUser] = useState(INIT_USER) const [user, setUser] = useState(INIT_USER)
const [error, setError] = useState('') const [error, setError] = useState('')
const [disabled, setDisabled] = useState(true) const [disabled, setDisabled] = useState(true)
const [success, setSuccess] = useState(false) const [success, setSuccess] = useState(false)
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
useEffect(() => { useEffect(() => {
...@@ -54,9 +54,9 @@ function SingUp() { ...@@ -54,9 +54,9 @@ function SingUp() {
return ( return (
<> <>
<Menu /> <Menu />
<Form onSubmit={handleSubmit} className='vh-100 flex-column align-items-center justify-content-center mt-2'> <Form onSubmit={handleSubmit} className="vh-90 flex-column align-items-center justify-content-center mt-2" variant="dark">
<Container className="d-flex justify-content-center"> <div className="d-flex justify-content-center">
<div className="mt-5 p-5 shadow w-75"> <div className="mt-5 p-5 mr-2" style={{ display: "flex", flexDirection: "column", borderStyle: "solid", borderRadius: "5px", borderColor: "#4A5D7E", backgroundColor: "#FFFFFF", padding: '15px', position: "relative" }}>
<h2 className="text-center ">회원가입</h2> <h2 className="text-center ">회원가입</h2>
...@@ -129,7 +129,7 @@ function SingUp() { ...@@ -129,7 +129,7 @@ function SingUp() {
{error} {error}
</Alert>} </Alert>}
</div> </div>
</Container> </div>
</Form> </Form>
</> </>
) )
......
...@@ -7,10 +7,9 @@ export function handleLogin(data) { ...@@ -7,10 +7,9 @@ export function handleLogin(data) {
} }
export async function handleLogout() { export async function handleLogout() {
alert('로그아웃 되었습니다')
sessionStorage.clear(); sessionStorage.clear();
await axios.get('/auth/logout') await axios.get('/auth/logout')
//login페이지로 이동
// window.location.href='/login'
} }
export function isAuthenticated() { export function isAuthenticated() {
......
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