Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정민우
/
vps_service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
ch4n3.yoon
2021-05-14 17:02:05 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9778cc4e8f33f1393d8d422f4aa4a138b25c0340
9778cc4e
1 parent
e30e705c
[Edit] Sign In 서버 연결
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
1 deletions
frontend/src/components/SignIn.js
frontend/src/components/SignIn.js
View file @
9778cc4
...
...
@@ -24,6 +24,16 @@ import {
InputGroup
,
InputLeftElement
,
InputRightElement
,
Alert
,
AlertIcon
,
AlertTitle
,
AlertDescription
,
AlertDialog
,
AlertDialogBody
,
AlertDialogFooter
,
AlertDialogHeader
,
AlertDialogContent
,
AlertDialogOverlay
,
}
from
'@chakra-ui/react'
import
{
PhoneIcon
}
from
'@chakra-ui/icons'
import
http
from
'../utils/http'
...
...
@@ -31,6 +41,10 @@ import http from '../utils/http'
const
SignIn
=
()
=>
{
const
[
username
,
setUsername
]
=
useState
(
''
)
const
[
password
,
setPassword
]
=
useState
(
''
)
const
[
isSuccess
,
setSuccess
]
=
useState
(
false
)
const
cancelRef
=
React
.
useRef
()
const
onClose
=
()
=>
setSuccess
(
false
)
const
handleUsernameOnChange
=
(
event
)
=>
{
setUsername
(
event
.
target
.
value
)
...
...
@@ -40,6 +54,14 @@ const SignIn = () => {
setPassword
(
event
.
target
.
value
)
}
const
signIn
=
()
=>
{
http
.
post
(
'/login'
).
then
(
response
=>
{
const
{
success
,
code
,
data
,
message
}
=
response
.
data
if
(
success
)
{
}
})
}
useEffect
(()
=>
{
},
[])
...
...
@@ -47,7 +69,7 @@ const SignIn = () => {
return
(
<
Container
>
<
Heading
>
Sign
-
In
<
/Heading>
<
br
/>
<
br
/>
<
Stack
// divider={<StackDivider borderColor="gray.200"/>}
...
...
@@ -75,10 +97,26 @@ const SignIn = () => {
<
Button
colorScheme
=
"teal"
onClick
=
{()
=>
signIn
()}
>
Sign
In
<
/Button>
<
/Stack>
<
AlertDialog
isOpen
=
{
isSuccess
}
leastDestructiveRef
=
{
cancelRef
}
onClose
=
{
onClose
}
>
<
AlertDialogOverlay
>
<
AlertDialogContent
>
<
Alert
status
=
"success"
>
<
AlertIcon
/>
Successfully
signed
in
!
<
/Alert>
<
/AlertDialogContent>
<
/AlertDialogOverlay>
<
/AlertDialog>
<
/Container>
)
}
...
...
Please
register
or
login
to post a comment