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
c0c48149
Commit
c0c48149
authored
Dec 30, 2020
by
이재연
Browse files
기능하려다가 지움..
parent
4f2429b3
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
client/.eslintcache
View file @
c0c48149
This diff is collapsed.
Click to expand it.
client/src/Auth.js
View file @
c0c48149
...
...
@@ -7,5 +7,4 @@ export function signIn({id,password}){
const
user
=
users
.
find
(
user
=>
user
.
id
===
id
&&
user
.
password
===
password
);
if
(
user
===
undefined
)
throw
new
Error
();
return
user
;
}
\ No newline at end of file
client/src/Pages/Login.js
View file @
c0c48149
...
...
@@ -2,23 +2,9 @@ import React, { useState, useEffect, useRef } from 'react';
import
Nav1
from
'
../Components/MainNav
'
;
import
Nav2
from
'
../Components/SubNav
'
;
import
{
Form
,
Col
,
Container
,
Button
,
Row
}
from
'
react-bootstrap
'
import
{
Link
,
Redirect
}
from
'
react-router-dom
'
function
Login
(
authenticated
,
login
,
location
)
{
const
[
id
,
setId
]
=
useState
(
""
);
const
[
password
,
setPassword
]
=
useState
(
""
);
const
handleClick
=
()
=>
{
try
{
Login
({
id
,
password
})
}
catch
(
e
)
{
alert
(
"
Failed to login
"
)
setId
(
""
)
setPassword
(
""
)
}
}
import
{
Link
,
Redirect
}
from
'
react-router-dom
'
function
login
(){
return
(
<
div
>
<
Nav1
/>
...
...
@@ -26,20 +12,21 @@ function Login(authenticated,login,location) {
<
Container
className
=
"
my-5
"
>
<
Row
className
=
"
justify-content-center
"
>
<
Col
md
=
{
5
}
xs
=
{
10
}
className
=
"
border
"
>
<
Col
md
=
{
5
}
xs
=
{
10
}
className
=
"
border
"
style
=
{{
background
:
'
#F7F3F3
'
}}
>
<
h3
className
=
"
text-center mt-5
"
>
Login
<
/h3
>
<
Form
className
=
"
p-5
"
>
<
Form
.
Group
controlId
=
"
formBasicId
"
>
<
Form
.
Row
>
<
Form
.
Label
for
=
"
id
"
>
User
Name
<
/Form.Label
>
<
Form
.
Label
for
=
"
id
"
>
아이디
<
/Form.Label
>
<
Col
>
<
Form
.
Control
type
=
"
text
"
value
=
{
id
}
onChange
=
{({
target
:{
value
}})
=>
setId
(
value
)}
className
=
"
mx-sm-3
"
size
=
"
sm
"
placeholder
=
"
User Name
"
>
<
Form
.
Control
type
=
"
text
"
id
=
"
id
"
value
=
{
id
}
onChange
=
{({
target
:
{
value
}
})
=>
user
.
d
(
value
)}
className
=
"
mx-sm-3
"
size
=
"
sm
"
placeholder
=
"
ID
"
>
<
/Form.Control
>
<
/Col
>
<
/Form.Row
>
...
...
@@ -47,19 +34,20 @@ function Login(authenticated,login,location) {
<
Form
.
Group
controlId
=
"
formBasicPassword
"
>
<
Form
.
Row
>
<
Form
.
Label
for
=
"
password
"
>
Password
<
/Form.Label
>
<
Form
.
Label
for
=
"
password
"
>
비밀번호
<
/Form.Label
>
<
Col
>
<
Form
.
Control
type
=
"
password
"
value
=
{
password
}
onChange
=
{({
target
:{
value
}})
=>
setPassword
(
value
)}
className
=
"
mx-sm-3
"
size
=
"
sm
"
placeholder
=
"
Password
"
><
/Form.Control
>
<
Form
.
Control
type
=
"
password
"
id
=
"
password
"
value
=
{
password
}
onChange
=
{({
target
:
{
value
}
})
=>
user
.
password
(
value
)}
className
=
"
mx-sm-3
"
size
=
"
sm
"
placeholder
=
"
Password
"
><
/Form.Control
>
<
/Col
>
<
/Form.Row
>
<
/Form.Group
>
<
Button
variant
=
"
outline-dark
"
type
=
"
submit
"
onClick
=
{
handleClick
}
block
>
Login
<
/Button
>
<
Button
style
=
{{
background
:
'
#91877F
'
,
borderColor
:
'
#91877F
'
}}
type
=
"
submit
"
block
>
Login
<
/Button
>
<
div
className
=
"
loginLine
"
>
<
Link
to
=
"
/signup
"
>
SignUp
?
<
/Link
>
<
Link
to
=
"
/signup
"
style
=
{{
color
:
'
#91877F
'
}}
onClick
=
{
handleClick
}
>
회원이
아니십니까
?
<
/Link
>
<
/div
>
<
/Form
>
<
/Col
>
...
...
client/src/Pages/Signup.js
View file @
c0c48149
...
...
@@ -15,87 +15,88 @@ function Signup() {
<
Nav2
/>
<
Container
className
=
"
my-5
"
>
<
Row
className
=
"
justify-content-center
"
>
<
Col
md
=
{
6
}
xs
=
{
10
}
className
=
"
border
"
>
<
Col
md
=
{
6
}
xs
=
{
10
}
className
=
"
border
"
style
=
{{
background
:
'
#F7F3F3
'
}}
>
<
h2
className
=
"
text-center mt-5
"
>
Sign
Up
<
/h2
>
<
Form
className
=
"
p-5
"
>
<
Form
.
Group
controlId
=
"
formBasicId
"
>
<
Form
.
Row
>
<
Form
.
Label
for
=
"
id
"
>
User
Name
<
/Form.Label
>
<
Col
>
<
Form
.
Control
type
=
"
text
"
id
=
"
id
"
size
=
"
sm
"
placeholder
=
"
UserName
"
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
/Col
>
<
/Form.Row
>
<
/Form.Group
>
<
Form
.
Group
controlId
=
"
formBasicName
"
>
<
Form
.
Row
>
<
Form
.
Label
for
=
"
name
"
>
Real
Name
<
/Form.Label
>
<
Form
.
Label
for
=
"
name
"
>
이
름
<
/Form.Label
>
<
Col
>
<
Form
.
Control
type
=
"
text
"
id
=
"
name
"
size
=
"
sm
"
placeholder
=
"
Enter your Real Name
"
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
Form
.
Control
type
=
"
text
"
id
=
"
name
"
size
=
"
sm
"
placeholder
=
""
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
/Col
>
<
/Form.Row
>
<
/Form.Group
>
<
Form
.
Group
controlId
=
"
formBasicNumber
"
>
<
Form
.
Row
>
<
Form
.
Label
for
=
"
number
"
>
Resident
registration
number
<
/Form.Label
>
<
Form
.
Label
for
=
"
number
"
>
주민등록번호
<
/Form.Label
>
<
Col
as
=
{
Row
}
>
<
Form
.
Control
type
=
"
text
"
id
=
"
number1
"
size
=
"
sm
"
maxlength
=
"
6
"
className
=
"
mx-sm-3
"
style
=
{{
width
:
'
120px
'
}}
><
/Form.Control
>
<
Form
.
Control
type
=
"
text
"
id
=
"
number1
"
size
=
"
sm
"
maxlength
=
"
6
"
className
=
"
mx-sm-3
"
style
=
{{
width
:
'
120px
'
}}
><
/Form.Control
>
-
<
Form
.
Control
type
=
"
text
"
id
=
"
number2
"
size
=
"
sm
"
maxlength
=
"
1
"
className
=
"
mx-sm-3
"
style
=
{{
width
:
'
25px
'
}}
><
/Form.Control
>
<
Form
.
Control
type
=
"
text
"
id
=
"
number2
"
size
=
"
sm
"
maxlength
=
"
1
"
className
=
"
mx-sm-3
"
style
=
{{
width
:
'
25px
'
}}
><
/Form.Control
>
******
<
/Col
>
<
/Form.Row
>
<
/Form.Group
>
<
Form
.
Group
controlId
=
"
formBasicId
"
>
<
Form
.
Row
>
<
Form
.
Label
for
=
"
id
"
>
아이디
<
/Form.Label
>
<
Col
>
<
Form
.
Control
type
=
"
text
"
id
=
"
id
"
size
=
"
sm
"
placeholder
=
"
ID
"
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
/Col
>
<
/Form.Row
>
<
/Form.Group
>
<
Form
.
Group
controlId
=
"
formBasicPassword
"
>
<
Form
.
Row
>
<
Form
.
Label
for
=
"
password
"
>
Password
<
/Form.Label
>
<
Form
.
Label
for
=
"
password
"
>
비밀번호
<
/Form.Label
>
<
Col
>
<
Form
.
Control
type
=
"
password
"
id
=
"
password
"
size
=
"
sm
"
aria
-
describedby
=
"
passwordHelpBlock
"
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
Form
.
Text
id
=
"
password
"
muted
>
Must
be
8
-
20
characters
long
.
<
/Form.Text
>
<
Form
.
Control
type
=
"
password
"
id
=
"
password
"
size
=
"
sm
"
placeholder
=
"
Password
"
aria
-
describedby
=
"
passwordHelpBlock
"
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
Form
.
Text
id
=
"
password
"
muted
>
8
-
15
자로
입력해주세요
.
<
/Form.Text
>
<
/Col
>
<
/Form.Row
>
<
/Form.Group
>
<
Form
.
Group
controlId
=
"
formBasicPassword2
"
>
<
Form
.
Row
>
<
Form
.
Label
for
=
"
password2
"
>
Confirm
Password
<
/Form.Label
>
<
Form
.
Label
for
=
"
password2
"
>
비밀번호
확인
<
/Form.Label
>
<
Col
>
<
Form
.
Control
type
=
"
password
"
id
=
"
password2
"
size
=
"
sm
"
placeholder
=
"
Confirm Password
"
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
Form
.
Control
type
=
"
password
"
id
=
"
password2
"
size
=
"
sm
"
placeholder
=
""
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
/Col
>
<
/Form.Row
>
<
/Form.Group
>
<
Form
.
Group
controlId
=
"
formBasicTel
"
>
<
Form
.
Row
>
<
Form
.
Label
for
=
"
tel
"
>
Phone
Number
<
/Form.Label
>
<
Form
.
Label
for
=
"
tel
"
>
휴대전화
<
/Form.Label
>
<
Col
>
<
Form
.
Control
type
=
"
text
"
id
=
"
tel
"
size
=
"
sm
"
placeholder
=
"
Enter your Phone Number
"
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
Form
.
Control
type
=
"
text
"
id
=
"
tel
"
size
=
"
sm
"
placeholder
=
""
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
/Col
>
<
/Form.Row
>
<
/Form.Group
>
<
Form
.
Group
controlId
=
"
formBasicAdd
"
>
<
Form
.
Row
>
<
Form
.
Label
>
Address
<
/Form.Label
>
<
Form
.
Label
>
주
소
<
/Form.Label
>
<
Col
>
<
Form
.
Control
type
=
"
text
"
id
=
"
add
"
size
=
"
sm
"
placeholder
=
"
Enter your Address
"
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
Form
.
Control
type
=
"
text
"
id
=
"
add
"
size
=
"
sm
"
placeholder
=
"
상세주소
"
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
/Col
>
<
/Form.Row
>
<
/Form.Group
>
<
Button
variant
=
"
outline-dark
"
type
=
"
submit
"
block
>
Sign
Up
<
/Button
>
<
Button
style
=
{{
background
:
'
#91877F
'
,
borderColor
:
'
#91877F
'
}}
type
=
"
submit
"
block
>
Sign
Up
<
/Button
>
<
/Form
>
<
/Col
>
...
...
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