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
4fdcce9a
Commit
4fdcce9a
authored
Mar 15, 2021
by
우지원
Browse files
Merge remote-tracking branch 'origin/sooModalTest' into jiweon827
parents
4feac4b2
e32c9aa7
Changes
2
Hide whitespace changes
Inline
Side-by-side
client/src/Components/EnterRoom.js
View file @
4fdcce9a
import
React
,
{
useState
}
from
'
react
'
import
axios
from
'
axios
'
;
import
{
Row
,
Col
,
Modal
,
Button
,
Form
}
from
'
react-bootstrap
'
;
import
{
Row
,
Col
,
Modal
,
Button
,
Form
,
Alert
}
from
'
react-bootstrap
'
;
import
catchErrors
from
'
../utils/catchErrors
'
...
...
@@ -13,17 +13,17 @@ function EnterRoom(props) {
async
function
recordEntryLog
()
{
const
leaveInfo
=
{
userId
:
userId
,
roomCode
:
enterCode
,
leaveTime
:
realTime
}
try
{
const
check
=
await
axios
.
get
(
'
/room/entrylog
'
,
{
params
:
leaveInfo
})
if
(
check
.
data
)
{
//있으면 put으로
await
axios
.
put
(
'
/room/entrylog
'
,
leaveInfo
)
}
else
{
//없으면 post
await
axios
.
post
(
'
/room/entrylog
'
,
leaveInfo
)
}
const
check
=
await
axios
.
get
(
'
/room/entrylog
'
,
{
params
:
leaveInfo
})
if
(
check
.
data
)
{
//있으면 put으로
await
axios
.
put
(
'
/room/entrylog
'
,
leaveInfo
)
}
else
{
//없으면 post
await
axios
.
post
(
'
/room/entrylog
'
,
leaveInfo
)
}
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
catchErrors
(
error
,
setError
)
}
}
}
function
handleChange
(
event
)
{
const
{
name
,
value
}
=
event
.
target
...
...
@@ -57,6 +57,9 @@ function EnterRoom(props) {
<
Modal
.
Header
closeButton
>
<
Modal
.
Title
>
참여
코드로
채팅
참가
<
/Modal.Title
>
<
/Modal.Header
>
{
error
&&
<
Alert
variant
=
'
danger
'
>
{
error
}
<
/Alert>
}
<
Modal
.
Body
>
<
Form
onSubmit
=
{
handleSubmit
}
>
<
Form
.
Group
as
=
{
Row
}
controlId
=
"
formCodeE
"
>
...
...
@@ -67,7 +70,7 @@ function EnterRoom(props) {
<
/Form.Group
>
<
Form
.
Group
as
=
{
Row
}
>
<
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
>
<
/Form.Group
>
<
/Form
>
...
...
docs/메신저ppt.pptx
0 → 100644
View file @
4fdcce9a
File added
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