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
dea888ad
Commit
dea888ad
authored
Jan 14, 2021
by
우지원
Browse files
받는거 id로 수정
parent
aa88e353
Changes
3
Show whitespace changes
Inline
Side-by-side
client/src/Components/Chat.js
View file @
dea888ad
...
@@ -18,7 +18,7 @@ function Chat(props) {
...
@@ -18,7 +18,7 @@ function Chat(props) {
async
function
getLoginedUser
()
{
//email로 db에서 찾아오기 ㅇㅇㅇㅇㅇ
async
function
getLoginedUser
()
{
//email로 db에서 찾아오기 ㅇㅇㅇㅇㅇ
const
userid
=
localStorage
.
getItem
(
'
user
'
)
const
userid
=
localStorage
.
getItem
(
'
user
'
)
const
response
=
await
axios
.
post
(
`/users/
${
userid
}
`
,
{
'
email
'
:
userid
})
const
response
=
await
axios
.
post
(
`/users/
${
userid
}
`
,
{
'
_id
'
:
userid
})
setUsername
(
response
.
data
.
username
)
setUsername
(
response
.
data
.
username
)
}
}
useEffect
(()
=>
{
useEffect
(()
=>
{
...
...
client/src/Pages/ProfilePage.js
View file @
dea888ad
...
@@ -28,7 +28,7 @@ function ProfilePage() {
...
@@ -28,7 +28,7 @@ function ProfilePage() {
async
function
getLoginedUser
()
{
//email로 db에서 찾아오기 ㅇㅇㅇㅇㅇ
async
function
getLoginedUser
()
{
//email로 db에서 찾아오기 ㅇㅇㅇㅇㅇ
const
userid
=
localStorage
.
getItem
(
'
user
'
)
const
userid
=
localStorage
.
getItem
(
'
user
'
)
const
response
=
await
axios
.
post
(
`/users/
${
userid
}
`
,
{
'
email
'
:
userid
})
const
response
=
await
axios
.
post
(
`/users/
${
userid
}
`
,
{
'
_id
'
:
userid
})
setUser
(
response
.
data
)
setUser
(
response
.
data
)
}
}
...
...
client/src/Pages/SignUpPage.js
View file @
dea888ad
...
@@ -13,7 +13,7 @@ const INIT_USER = {
...
@@ -13,7 +13,7 @@ const INIT_USER = {
}
}
function
SingUp
()
{
function
SingUp
()
{
const
[
validated
,
setValidated
]
=
useState
(
false
);
//
const [validated, setValidated] = useState(false);
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
)
...
@@ -37,13 +37,13 @@ function SingUp() {
...
@@ -37,13 +37,13 @@ function SingUp() {
event
.
preventDefault
();
event
.
preventDefault
();
//빈문자열 입력 시 오류 문자 출력
//빈문자열 입력 시 오류 문자 출력
const
form
=
event
.
currentTarget
;
//
const form = event.currentTarget;
if
(
form
.
checkValidity
()
===
false
)
{
//
if (form.checkValidity() === false) {
event
.
preventDefault
();
//
event.preventDefault();
event
.
stopPropagation
();
//
event.stopPropagation();
//event.stopPropagation() : 이벤트 캡쳐링과 버블링에 있어 현재 이벤트 이후의 전파를 막습니다.
//
//event.stopPropagation() : 이벤트 캡쳐링과 버블링에 있어 현재 이벤트 이후의 전파를 막습니다.
}
//
}
setValidated
(
true
);
//
setValidated(true);
// console.log(user)
// console.log(user)
try
{
try
{
...
@@ -82,7 +82,7 @@ function SingUp() {
...
@@ -82,7 +82,7 @@ function SingUp() {
<>
<>
<
Menu
/>
<
Menu
/>
<
Form
noValidate
validated
=
{
validated
}
onSubmit
=
{
handleSubmit
}
className
=
'
vh-100 flex-column align-items-center justify-content-center mt-2
'
>
<
Form
onSubmit
=
{
handleSubmit
}
className
=
'
vh-100 flex-column align-items-center justify-content-center mt-2
'
>
<
Container
className
=
"
d-flex justify-content-center
"
>
<
Container
className
=
"
d-flex justify-content-center
"
>
<
div
className
=
"
mt-5 p-5 shadow w-75
"
>
<
div
className
=
"
mt-5 p-5 shadow w-75
"
>
...
...
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