Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
students
messenger
Commits
5e028ffa
You need to sign in or sign up before continuing.
Commit
5e028ffa
authored
Jan 15, 2021
by
Choi Ga Young
Browse files
Merge remote-tracking branch 'origin/yeonwoo' into young
parents
cb575cad
a6cc8349
Changes
8
Hide whitespace changes
Inline
Side-by-side
client/src/Components/Chat.js
View file @
5e028ffa
...
@@ -49,7 +49,6 @@ function Chat(props) {
...
@@ -49,7 +49,6 @@ function Chat(props) {
<
Form
.
Control
name
=
'
msg
'
type
=
'
text
'
onChange
=
{
handleChange
}
/
>
<
Form
.
Control
name
=
'
msg
'
type
=
'
text
'
onChange
=
{
handleChange
}
/
>
<
Button
variant
=
"
primary
"
type
=
"
submit
"
>
전송
<
/Button
>
<
Button
variant
=
"
primary
"
type
=
"
submit
"
>
전송
<
/Button
>
<
/Form
>
<
/Form
>
<
/div
>
<
/div
>
...
...
client/src/Components/Menu.js
View file @
5e028ffa
import
React
from
'
react
'
import
React
,
{
useState
,
useEffect
}
from
'
react
'
import
{
Navbar
,
Nav
,
Button
}
from
'
react-bootstrap
'
;
import
{
Navbar
,
Nav
,
Button
}
from
'
react-bootstrap
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
handleLogout
}
from
'
../utils/auth
'
;
import
{
handleLogout
}
from
'
../utils/auth
'
;
import
axios
from
'
axios
'
function
Menu
()
{
function
Menu
()
{
...
...
client/src/Pages/HomePage.js
View file @
5e028ffa
...
@@ -14,6 +14,8 @@ import { io } from "socket.io-client"; //모듈 가져오기
...
@@ -14,6 +14,8 @@ import { io } from "socket.io-client"; //모듈 가져오기
const
socket
=
io
();
const
socket
=
io
();
function
Home
()
{
function
Home
()
{
const
[
username
,
setUsername
]
=
useState
(
'
defaultUser
'
)
const
[
show
,
setShow
]
=
useState
(
false
);
const
[
show
,
setShow
]
=
useState
(
false
);
const
[
chat
,
setChat
]
=
useState
(
false
);
const
[
chat
,
setChat
]
=
useState
(
false
);
...
...
client/src/Pages/ProfilePage.js
View file @
5e028ffa
...
@@ -5,10 +5,10 @@ import { Image, Button, Container, Form, FormControl, Navbar, Nav, Row, Col, Dro
...
@@ -5,10 +5,10 @@ import { Image, Button, Container, Form, FormControl, Navbar, Nav, Row, Col, Dro
import
{
BrowserRouter
as
Router
,
Route
,
Redirect
,
Switch
,
Link
}
from
'
react-router-dom
'
;
import
{
BrowserRouter
as
Router
,
Route
,
Redirect
,
Switch
,
Link
}
from
'
react-router-dom
'
;
import
axios
from
'
axios
'
import
axios
from
'
axios
'
import
userdefault
from
'
./KakaoTalk_20201230_153151693.png
'
import
userdefault
from
'
.
./Images
/KakaoTalk_20201230_153151693.png
'
import
img1
from
'
./img_1.png
'
import
img1
from
'
.
./Images
/img_1.png
'
import
img2
from
'
./img_2.png
'
import
img2
from
'
.
./Images
/img_2.png
'
import
img3
from
'
./img_3.jpg
'
import
img3
from
'
.
./Images
/img_3.jpg
'
import
DropdownItem
from
'
react-bootstrap/esm/DropdownItem
'
;
import
DropdownItem
from
'
react-bootstrap/esm/DropdownItem
'
;
...
@@ -39,7 +39,6 @@ function ProfilePage() {
...
@@ -39,7 +39,6 @@ function ProfilePage() {
}
else
{
}
else
{
setHidden
(
true
)
setHidden
(
true
)
}
}
console
.
log
(
document
.
cookie
)
}
}
function
handleChange
(
e
)
{
function
handleChange
(
e
)
{
setUser
({
...
user
,
'
nickname
'
:
e
.
target
.
value
})
setUser
({
...
user
,
'
nickname
'
:
e
.
target
.
value
})
...
@@ -94,27 +93,23 @@ function ProfilePage() {
...
@@ -94,27 +93,23 @@ function ProfilePage() {
return
(
return
(
<
div
>
<
div
>
<
Menu
/>
<
Menu
/>
<
Container
>
<
Container
className
=
'
border
'
fluid
>
<
Row
><
h1
>
ProfilePage
<
/h1></
Row
>
<
Row
><
h2
>
{
user
.
username
}
님
환영합니다
!<
/h2></
Row
>
<
/Container
>
<
Container
className
=
"
mt-5 shadow w-75
"
>
<
Row
>
<
Row
>
<
Col
sm
=
{
4
}
>
<
Col
sm
=
{
4
}
>
<
Row
>
<
Row
className
=
'
justify-content-center
'
>
<
div
className
=
"
d-flex
justify-content-center
m
b
-3
"
id
=
"
defaultImg
"
>
<
div
className
=
"
d-flex
ml-3
m
t
-3
"
id
=
"
defaultImg
"
>
<
Image
src
=
{
userimg
}
width
=
"
300px
"
roundedCircle
/>
<
Image
src
=
{
userimg
}
width
=
"
300px
"
roundedCircle
/>
<
/div
>
<
/div
>
<
/Row
>
<
/Row
>
<
Row
>
<
Row
className
=
'
ml-3 mt-3 justify-content-center
'
>
<
Form
className
=
"
d-flex
justify-content-center
"
>
<
Form
className
=
"
d-flex
"
>
<
Form
.
Group
>
<
Form
.
Group
>
<
div
id
=
"
image_container
"
><
/div
>
<
div
id
=
"
image_container
"
><
/div
>
<
Form
.
File
label
=
"
프로필 사진 변경
"
accept
=
"
image/*
"
onChange
=
{
setThumbnail
}
/
>
<
Form
.
File
label
=
"
프로필 사진 변경
"
accept
=
"
image/*
"
onChange
=
{
setThumbnail
}
/
>
<
/Form.Group
>
<
/Form.Group
>
<
/Form
>
<
/Form
>
<
/Row
>
<
/Row
>
<
Row
className
=
"
d-flex justify-content-center
"
>
<
Row
className
=
"
d-flex justify-content-center
mb-3
"
>
<
Dropdown
>
<
Dropdown
>
<
Dropdown
.
Toggle
variant
=
'
success
'
id
=
'
dropdown-basic
'
>
<
Dropdown
.
Toggle
variant
=
'
success
'
id
=
'
dropdown-basic
'
>
프로필
사진
선택
프로필
사진
선택
...
@@ -128,34 +123,35 @@ function ProfilePage() {
...
@@ -128,34 +123,35 @@ function ProfilePage() {
<
/Row
>
<
/Row
>
<
/Col
>
<
/Col
>
<
Col
sm
=
{
8
}
>
<
Col
sm
=
{
8
}
>
<
Row
className
=
'
m-5 justify-content-center
'
>
<
Row
className
=
"
m-3 justify-content-flex-start
"
style
=
{{
fontWeight
:
"
bold
"
,
fontSize
:
"
x-large
"
}}
>
<
h2
>
{
user
.
username
}
님의
프로필
정보
<
/h2
>
<
Col
sm
=
{
2.5
}
>
이름
:
<
/Col
>
<
Col
sm
=
{
8
}
>
{
user
.
username
}
<
/Col
>
<
/Row
>
<
/Row
>
<
Row
className
=
"
m-3 justify-content-flex-start
"
id
=
"
nickname
"
>
<
Row
className
=
"
m-3 justify-content-flex-start
"
style
=
{{
fontWeight
:
"
bold
"
,
fontSize
:
"
large
"
}}
>
<
Form
className
=
"
d-flex
"
onSubmit
=
{
handleSubmit
}
style
=
{{
fontWeight
:
"
bold
"
,
fontSize
:
"
x-large
"
}}
>
<
Col
xs
=
{
3
}
>
이름
:
<
/Col
>
<
Col
xs
=
{
6
}
>
{
user
.
username
}
<
/Col
>
<
Row
>
{
/* <Col sm={4}></Col> */
}
<
Col
>
별명
:
<
/Col
>
<
Col
hidden
=
{
!
hidden
}
>
{
user
.
nickname
}
<
/Col
>
<
Col
hidden
=
{
hidden
}
>
<
Form
.
Control
defaultValue
=
{
user
.
nickname
}
style
=
{{
width
:
"
110%
"
}}
onChange
=
{
handleChange
}
/
>
<
/Col
>
<
Col
>
<
Button
className
=
"
ml-3 d-flex justify-content-end
"
variant
=
"
outline-primary
"
size
=
"
sm
"
type
=
'
submit
'
>
수정
<
/Button
>
<
/Col
>
<
/Row
>
<
/Form
>
<
/Row
>
<
/Row
>
<
Row
className
=
"
m-3
"
style
=
{{
fontWeight
:
"
bold
"
,
fontSize
:
"
x-large
"
}}
>
<
Row
className
=
"
m-3 justify-content-flex-start
"
id
=
"
nickname
"
style
=
{{
fontWeight
:
"
bold
"
,
fontSize
:
"
large
"
}}
>
<
Col
sm
=
{
2.5
}
>
이메일
:
<
/Col
>
<
Col
xs
=
{
3
}
>
별명
:
<
/Col
>
<
Col
sm
=
{
8
}
>
{
user
.
email
}
<
/Col
>
<
Col
xs
=
{
6
}
hidden
=
{
!
hidden
}
>
{
user
.
nickname
}
<
/Col
>
<
Col
xs
=
{
6
}
hidden
=
{
hidden
}
>
<
Form
>
<
Form
.
Control
defaultValue
=
{
user
.
nickname
}
style
=
{{
width
:
"
110%
"
}}
onChange
=
{
handleChange
}
/
>
<
/Form
>
<
/Col
>
<
Col
xs
=
{
3
}
>
<
Form
className
=
"
d-flex
"
onSubmit
=
{
handleSubmit
}
>
<
Button
className
=
"
ml-3 d-flex justify-content-end
"
variant
=
"
outline-primary
"
size
=
"
sm
"
type
=
'
submit
'
>
수정
<
/Button
>
<
/Form
>
<
/Col
>
<
/Row
>
<
/Row
>
<
Row
className
=
'
justify-content-center
'
>
<
Row
className
=
"
m-3
"
style
=
{{
fontWeight
:
"
bold
"
,
fontSize
:
"
large
"
}}
>
<
Col
xs
=
{
3
}
>
이메일
:
<
/Col
>
<
Col
xs
=
{
6
}
>
{
user
.
email
}
<
/Col
>
<
/Row
>
<
Row
className
=
'
m-3 justify-content-center
'
>
<
Form
>
<
Form
>
<
Button
variant
=
"
outline-success
"
size
=
"
sm
"
className
=
"
mr-4
"
onClick
=
{
handleNicksave
}
>
저장
<
/Button
>
<
Button
variant
=
"
outline-success
"
size
=
"
sm
"
className
=
"
mr-4
"
onClick
=
{
handleNicksave
}
>
저장
<
/Button
>
<
Link
to
=
'
/
'
>
<
Link
to
=
'
/
'
>
...
@@ -166,94 +162,6 @@ function ProfilePage() {
...
@@ -166,94 +162,6 @@ function ProfilePage() {
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
<
/Container
>
<
/Container
>
<
Container
className
=
"
d-flex justify-content-center
"
>
<
div
className
=
"
mt-5 shadow w-75
"
>
<
h1
className
=
"
text-center mt-4 ml-5 mr-5 mb-3
"
>
Profile
Page
<
/h1
>
<
h4
className
=
"
text-center mb-5
"
>
{
user
.
username
}
님
환영합니다
!<
/h4
>
<
div
className
=
"
d-flex justify-content-center mb-3
"
id
=
"
defaultImg
"
>
<
Image
src
=
{
userimg
}
width
=
"
300px
"
roundedCircle
/>
<
/div
>
<
Row
className
=
"
d-flex justify-content-center
"
>
<
Form
className
=
"
d-flex justify-content-center
"
>
<
Form
.
Group
>
<
div
id
=
"
image_container
"
><
/div
>
<
Form
.
File
label
=
"
프로필 사진 변경
"
accept
=
"
image/*
"
onChange
=
{
setThumbnail
}
/
>
<
/Form.Group
>
<
/Form
>
<
/Row
>
<
Row
className
=
"
d-flex justify-content-center
"
>
<
Dropdown
>
<
Dropdown
.
Toggle
variant
=
'
success
'
id
=
'
dropdown-basic
'
>
프로필
사진
선택
<
/Dropdown.Toggle
>
<
Dropdown
.
Menu
>
<
Dropdown
.
Item
as
=
'
button
'
>
홈으로
<
/Dropdown.Item
>
<
Dropdown
.
Item
href
=
'
/
'
>
라이언
<
/Dropdown.Item
>
<
Dropdown
.
Item
href
=
'
/
'
>
어피치
<
/Dropdown.Item
>
<
/Dropdown.Menu
>
<
/Dropdown
>
<
/Row
>
{
/* <Carousel className="d-flex justify-content-center" style={{ width: "300px", height: "300px" }}>
<Carousel.Item className="d-flex justify-content-center">
<Image
className="d-block w-100"
src={img1}
/>
<Carousel.Caption>
<p style={{color : 'black'}}>펭수입니다.</p>
</Carousel.Caption>
</Carousel.Item>
<Carousel.Item>
<Image
className="d-block w-100"
src={img2}
/>
<Carousel.Caption>
<p>라이언입니다.</p>
</Carousel.Caption>
</Carousel.Item>
<Carousel.Item>
<Image
className="d-block w-100"
src={img3}
/>
<Carousel.Caption>
<p>어피치 입니다.</p>
</Carousel.Caption>
</Carousel.Item>
</Carousel> */
}
<
div
className
=
"
text-center
"
>
<
div
className
=
"
m-3
"
style
=
{{
fontWeight
:
"
bold
"
,
fontSize
:
"
x-large
"
}}
>
이름
:
{
user
.
username
}
<
/div
>
<
div
className
=
"
m-3
"
id
=
"
nickname
"
>
<
Form
className
=
"
d-flex justify-content-center
"
onSubmit
=
{
handleSubmit
}
style
=
{{
fontWeight
:
"
bold
"
,
fontSize
:
"
x-large
"
}}
>
별명
:
<
div
hidden
=
{
!
hidden
}
>
{
user
.
nickname
}
<
/div
>
<
Form
.
Control
defaultValue
=
{
user
.
nickname
}
style
=
{{
width
:
"
40%
"
}}
size
=
"
sm
"
onChange
=
{
handleChange
}
hidden
=
{
hidden
}
/
>
<
Button
className
=
"
ml-3
"
variant
=
"
outline-primary
"
size
=
"
sm
"
type
=
'
submit
'
>
수정
<
/Button
>
<
/Form
>
<
/div
>
<
div
className
=
"
m-3
"
style
=
{{
fontWeight
:
"
bold
"
,
fontSize
:
"
x-large
"
}}
>
이메일
:
{
user
.
email
}
<
/div
>
<
/div
>
<
div
className
=
"
text-center m-5
"
>
<
Form
>
<
Button
variant
=
"
outline-success
"
size
=
"
sm
"
className
=
"
mr-4
"
onClick
=
{
handleNicksave
}
>
저장
<
/Button
>
<
Link
to
=
'
/
'
>
<
Button
variant
=
"
outline-success
"
size
=
"
sm
"
className
=
"
ml-4
"
>
홈
화면으로
<
/Button
>
<
/Link
>
<
/Form
>
<
/div
>
<
/div
>
<
/Container
>
<
/div
>
<
/div
>
)
)
}
}
...
...
server/controllers/profile.controller.js
deleted
100644 → 0
View file @
cb575cad
import
Profile
from
"
../models/profile.js
"
import
bcrypt
from
"
bcryptjs
"
;
import
jwt
from
'
jsonwebtoken
'
import
config
from
"
../config.js
"
const
getimage
=
async
(
req
,
res
)
=>
{
const
defaultimg
=
'
https://t1.daumcdn.net/cfile/tistory/2761AA4558A05CBE2A
'
// const newImg = await new Profile({
// defaultimg
// //required를 하였기 때문에 이중 하나라도 없으면 에러 발생
// }).save()
}
export
default
{
getimage
}
\ No newline at end of file
server/models/Room.js
View file @
5e028ffa
...
@@ -22,4 +22,4 @@ const RoomSchema = new mongoose.Schema({
...
@@ -22,4 +22,4 @@ const RoomSchema = new mongoose.Schema({
timestamps
:
true
timestamps
:
true
})
})
export
default
mongoose
.
models
.
RoomSchema
||
mongoose
.
model
(
'
Room
'
,
RoomSchema
)
export
default
mongoose
.
models
.
RoomSchema
||
mongoose
.
model
(
'
Room
'
,
RoomSchema
)
\ No newline at end of file
server/routes/profile.routes.js
deleted
100644 → 0
View file @
cb575cad
import
express
from
'
express
'
import
profileCtrl
from
"
../controllers/profile.controller.js
"
;
const
router
=
express
.
Router
()
router
.
route
(
'
/profile
'
)
.
get
(
profileCtrl
.
getimage
)
export
default
router
\ No newline at end of file
server/server.js
View file @
5e028ffa
...
@@ -2,7 +2,6 @@ import express from 'express'
...
@@ -2,7 +2,6 @@ import express from 'express'
import
connectDb
from
'
./utils/connectDb.js
'
import
connectDb
from
'
./utils/connectDb.js
'
import
userRouter
from
'
./routes/user.routes.js
'
import
userRouter
from
'
./routes/user.routes.js
'
import
authRouter
from
'
./routes/auth.routes.js
'
import
authRouter
from
'
./routes/auth.routes.js
'
import
profileRouter
from
'
./routes/profile.routes.js
'
import
bodyParser
from
"
body-parser
"
;
import
bodyParser
from
"
body-parser
"
;
import
http
from
"
http
"
;
import
http
from
"
http
"
;
...
@@ -47,7 +46,6 @@ app.use(bodyParser.json());
...
@@ -47,7 +46,6 @@ app.use(bodyParser.json());
app
.
use
(
userRouter
)
app
.
use
(
userRouter
)
app
.
use
(
authRouter
)
app
.
use
(
authRouter
)
app
.
use
(
profileRouter
)
//userRouter로 이동
//userRouter로 이동
app
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
app
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment