Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
messenger
Commits
0a02c1c5
Commit
0a02c1c5
authored
Jan 18, 2021
by
Choi Ga Young
Browse files
Merge remote-tracking branch 'origin/sooModalTest' into young
parents
b21d2576
7fc6b37a
Changes
5
Show whitespace changes
Inline
Side-by-side
client/src/Components/EnterRoom.js
View file @
0a02c1c5
...
@@ -18,7 +18,7 @@ function EnterRoom(props) {
...
@@ -18,7 +18,7 @@ function EnterRoom(props) {
event
.
preventDefault
()
event
.
preventDefault
()
try
{
try
{
setError
(
''
)
setError
(
''
)
//
await axios.post('/room/enterRoom', enterCode)
await
axios
.
post
(
'
/room/enterRoom
'
,
enterCode
)
props
.
enterChatRoom
(
enterCode
)
props
.
enterChatRoom
(
enterCode
)
setEnterCode
(
''
)
setEnterCode
(
''
)
}
catch
(
error
){
}
catch
(
error
){
...
...
client/src/Pages/HomePage.js
View file @
0a02c1c5
...
@@ -70,10 +70,10 @@ function Home() {
...
@@ -70,10 +70,10 @@ function Home() {
<
Col
className
=
"
list
"
md
=
{
5
}
>
<
Col
className
=
"
list
"
md
=
{
5
}
>
<
Tabs
defaultActiveKey
=
"
closed
"
id
=
"
uncontrolled-tab-example
"
>
<
Tabs
defaultActiveKey
=
"
closed
"
id
=
"
uncontrolled-tab-example
"
>
<
Tab
eventKey
=
"
closed
"
title
=
"
내 채팅
"
onClick
=
{
handleChato
}
>
<
Tab
eventKey
=
"
closed
"
title
=
"
내 채팅
"
onClick
=
{
handleChato
}
>
<
ClosedList
enterChat
r
oom
=
{
enterChat
r
oom
}
setRoomName
=
{
setRoomName
}
/
>
<
ClosedList
enterChat
R
oom
=
{
enterChat
R
oom
}
setRoomName
=
{
setRoomName
}
/
>
<
/Tab
>
<
/Tab
>
<
Tab
eventKey
=
"
open
"
title
=
"
공개방
"
>
<
Tab
eventKey
=
"
open
"
title
=
"
공개방
"
>
<
OpenList
enterChat
r
oom
=
{
enterChat
r
oom
}
setRoomName
=
{
setRoomName
}
/
>
<
OpenList
enterChat
R
oom
=
{
enterChat
R
oom
}
setRoomName
=
{
setRoomName
}
/
>
<
/Tab
>
<
/Tab
>
<
/Tabs
>
<
/Tabs
>
<
/Col
>
<
/Col
>
...
...
server/controllers/roomEnter.controller.js
0 → 100644
View file @
0a02c1c5
import
Room
from
"
../models/Room.js
"
const
roomEnter
=
async
(
req
,
res
)
=>
{
const
roomId
=
req
.
body
try
{
const
room
=
await
Room
.
findOne
({
roomId
})
if
(
!
room
)
{
return
res
.
status
(
404
).
send
(
`참여코드가 존재하지 않습니다.`
)
}
// room.member =
}
catch
(
error
)
{
//알수없는 모든 에러발생시 처리
console
.
log
(
error
)
res
.
status
(
500
).
send
(
'
로그인 에러가 발생하였습니다
'
)
}
}
export
default
{
roomEnter
}
\ No newline at end of file
server/routes/roomEnter.routers.js
0 → 100644
View file @
0a02c1c5
import
express
from
'
express
'
import
roomEnterCtrl
from
'
../controllers/roomEnter.controller.js
'
const
router
=
express
.
Router
()
router
.
route
(
'
/room/enterRoom
'
)
.
post
(
roomEnterCtrl
.
roomEnter
)
export
default
router
\ No newline at end of file
server/server.js
View file @
0a02c1c5
...
@@ -3,6 +3,7 @@ import connectDb from './utils/connectDb.js'
...
@@ -3,6 +3,7 @@ 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
roomRouter
from
'
./routes/room.routers.js
'
import
roomRouter
from
'
./routes/room.routers.js
'
import
roomEnterRouter
from
'
./routes/roomEnter.routers.js
'
import
bodyParser
from
"
body-parser
"
;
import
bodyParser
from
"
body-parser
"
;
import
http
from
"
http
"
;
import
http
from
"
http
"
;
import
{
Server
}
from
'
socket.io
'
;
import
{
Server
}
from
'
socket.io
'
;
...
@@ -47,6 +48,7 @@ app.use('/images', express.static('uploads/'))
...
@@ -47,6 +48,7 @@ app.use('/images', express.static('uploads/'))
app
.
use
(
userRouter
)
app
.
use
(
userRouter
)
app
.
use
(
authRouter
)
app
.
use
(
authRouter
)
app
.
use
(
roomRouter
)
app
.
use
(
roomRouter
)
app
.
use
(
roomEnterRouter
)
server
.
listen
(
3030
,
()
=>
{
server
.
listen
(
3030
,
()
=>
{
console
.
log
(
'
Listening on port 3030
'
)
console
.
log
(
'
Listening on port 3030
'
)
...
...
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