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
shopping-mall
Commits
62ff8335
Commit
62ff8335
authored
Jan 13, 2021
by
박상호
🎼
Browse files
MainNav까지
parent
be401a9c
Changes
2
Show whitespace changes
Inline
Side-by-side
client/src/Components/MainNav.js
View file @
62ff8335
...
...
@@ -15,7 +15,9 @@ function MainNav() {
{
'
'
}
KU
#
<
/Navbar.Brand
>
<
Nav
>
{
user
?
<
Nav
.
Link
className
=
"
text-light
"
onClick
=
{()
=>
handleLogout
()}
>
Logout
<
/Nav.Link
>
{
user
?
<>
<
Nav
.
Link
className
=
"
text-light
"
onClick
=
{()
=>
handleLogout
()}
>
Logout
<
/Nav.Link
>
<
Nav
.
Link
className
=
"
text-light
"
href
=
"
/account
"
>
Mypage
<
/Nav.Link
>
<
/
>
:
(
<>
<
Nav
.
Link
className
=
"
text-light
"
href
=
'
/login
'
>
Login
<
/Nav.Link
>
...
...
client/src/Pages/Signup.js
View file @
62ff8335
...
...
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
import
axios
from
'
axios
'
import
{
Form
,
Col
,
Container
,
Button
,
Row
,
Alert
}
from
'
react-bootstrap
'
import
catchErrors
from
'
../utils/catchErrors
'
import
{
Redirect
}
from
'
react-router-dom
'
;
const
INIT_USER
=
{
name
:
''
,
...
...
@@ -15,7 +16,7 @@ const INIT_USER = {
function
Signup
()
{
const
[
user
,
setUser
]
=
useState
(
INIT_USER
)
const
[
error
,
setError
]
=
useState
(
''
)
const
[
success
,
setSuccess
]
=
useState
(
false
)
const
[
validated
,
setValidated
]
=
useState
(
false
);
function
handleChange
(
event
)
{
...
...
@@ -39,12 +40,11 @@ function Signup() {
setError
(
''
)
const
response
=
await
axios
.
post
(
'
/api/users/signup
'
,
user
)
console
.
log
(
response
.
data
)
setSuccess
(
true
)
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
}
}
function
checkPassword
(
event
)
{
const
p1
=
user
.
password
...
...
@@ -60,6 +60,10 @@ function Signup() {
return
true
}
}
if
(
success
)
{
alert
(
'
회원가입 되었습니다.
'
)
return
<
Redirect
to
=
'
/login
'
/>
}
return
(
...
...
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