Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaeon Kim
client
Commits
71c8936a
Commit
71c8936a
authored
1 year ago
by
Gaeon Kim
Browse files
Options
Downloads
Patches
Plain Diff
feat: modify_loginpage
parent
39e3a2c0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pages/login.js
+12
-8
12 additions, 8 deletions
src/pages/login.js
src/pages/login.module.css
+6
-9
6 additions, 9 deletions
src/pages/login.module.css
with
18 additions
and
17 deletions
src/pages/login.js
+
12
−
8
View file @
71c8936a
import
React
,
{
useState
}
from
'
react
'
;
import
React
,
{
useState
}
from
'
react
'
;
import
styles
from
"
./login.module.css
"
import
styles
from
"
./login.module.css
"
import
{
useNavigate
}
from
'
react-router-dom
'
;
const
Login
=
()
=>
{
const
Login
=
()
=>
{
const
navigate
=
useNavigate
();
const
[
id
,
setId
]
=
useState
(
''
);
const
[
id
,
setId
]
=
useState
(
''
);
const
[
password
,
setPassword
]
=
useState
(
''
);
const
[
password
,
setPassword
]
=
useState
(
''
);
const
[
err
,
setError
]
=
useState
(
null
);
const
[
seePassword
,
setSeePassword
]
=
useState
(
true
);
const
[
seePassword
,
setSeePassword
]
=
useState
(
true
);
const
handleLogin
=
async
()
=>
{
const
handleLogin
=
async
()
=>
{
...
@@ -22,19 +24,19 @@ const Login=()=>{
...
@@ -22,19 +24,19 @@ const Login=()=>{
if
(
response
.
status
===
200
){
if
(
response
.
status
===
200
){
alert
(
data
);
alert
(
data
);
// 응답에서 access-token 추출
// 응답에서 access-token 추출
const
accessToken
=
data
[
'
access-token
'
];
//
const accessToken = data['access-token'];
// 쿠키에 저장
// 쿠키에 저장
document
.
cookie
=
`access-token=
${
accessToken
}
; path=/`
;
//
document.cookie = `access-token=${accessToken}; path=/`;
navigate
(
'
/api/schedules
'
);
}
else
if
(
response
.
status
===
400
){
}
else
if
(
response
.
status
===
400
){
alert
(
'
해당 정보의 유저가 존재하지 않습니다.
'
);
setError
(
'
해당 정보의 유저가 존재하지 않습니다.
'
);
}
}
else
{
else
{
console
.
log
(
"
Login failed
"
,
data
);
console
.
log
(
"
Login failed
"
,
data
);
}
}
}
catch
(
error
){
}
catch
(
error
){
console
.
log
(
'
error during login
'
,
error
);
alert
(
'
해당 정보의 유저가 존재하지 않습니다.
'
);
}
}
};
};
const
seePasswordHandler
=
()
=>
{
const
seePasswordHandler
=
()
=>
{
...
@@ -42,8 +44,9 @@ const Login=()=>{
...
@@ -42,8 +44,9 @@ const Login=()=>{
}
}
return
(
return
(
<
div
className
=
{
styles
.
whole
}
>
<
section
className
=
{
styles
.
login_container
}
>
<
section
className
=
{
styles
.
login_container
}
>
<
div
className
=
{
styles
.
logo_img
}
><
img
src
=
'
/
planpuzzle_
logo.png
'
height
=
'
80px
'
><
/img></
div
>
<
div
className
=
{
styles
.
logo_img
}
><
img
src
=
'
/logo.png
'
height
=
'
80px
'
><
/img></
div
>
<
div
className
=
{
styles
.
title
}
>
로그인
<
/div
>
<
div
className
=
{
styles
.
title
}
>
로그인
<
/div
>
<
div
className
=
{
styles
.
input_container
}
>
<
div
className
=
{
styles
.
input_container
}
>
<
div
className
=
{
styles
.
input_with_image
}
>
<
div
className
=
{
styles
.
input_with_image
}
>
...
@@ -64,7 +67,7 @@ const Login=()=>{
...
@@ -64,7 +67,7 @@ const Login=()=>{
value
=
{
password
}
value
=
{
password
}
placeholder
=
'
비밀번호
'
placeholder
=
'
비밀번호
'
onChange
=
{(
e
)
=>
setPassword
(
e
.
target
.
value
)}
/
>
onChange
=
{(
e
)
=>
setPassword
(
e
.
target
.
value
)}
/
>
<
span
className
=
{
styles
.
eye_img
}
><
img
src
=
{
seePassword
?
'
./eye
-o
ff.png
'
:
'
./eye
-o
n.png
'
}
<
span
className
=
{
styles
.
eye_img
}
><
img
src
=
{
seePassword
?
'
./eye
O
ff.png
'
:
'
./eye
O
n.png
'
}
alt
=
'
비밀번호 가시성 전환
'
alt
=
'
비밀번호 가시성 전환
'
height
=
'
18px
'
height
=
'
18px
'
width
=
'
17px
'
width
=
'
17px
'
...
@@ -81,6 +84,7 @@ const Login=()=>{
...
@@ -81,6 +84,7 @@ const Login=()=>{
<
div
className
=
{
styles
.
stick
}
>
―――――――――
<
span
className
=
{
styles
.
or
}
>
또는
<
/span>―――――――――</
div
>
<
div
className
=
{
styles
.
stick
}
>
―――――――――
<
span
className
=
{
styles
.
or
}
>
또는
<
/span>―――――――――</
div
>
<
div
className
=
{
styles
.
gotoJoin
}
>
아직
계정이
없으신가요
?
<
a
href
=
"
/api/users
"
className
=
{
styles
.
loginText
}
>
회원가입
<
/a></
div
>
<
div
className
=
{
styles
.
gotoJoin
}
>
아직
계정이
없으신가요
?
<
a
href
=
"
/api/users
"
className
=
{
styles
.
loginText
}
>
회원가입
<
/a></
div
>
<
/section>
<
/section>
<
/div
>
);
);
}
}
export
default
Login
;
export
default
Login
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/pages/login.module.css
+
6
−
9
View file @
71c8936a
...
@@ -53,9 +53,10 @@
...
@@ -53,9 +53,10 @@
border
:
none
;
border
:
none
;
outline
:
none
;
/* 선택 시 나타나는 외곽선 제거 */
outline
:
none
;
/* 선택 시 나타나는 외곽선 제거 */
background-color
:
#F7F8F8
;
background-color
:
#F7F8F8
;
margin-left
:
15px
;
margin-left
:
10%
;
margin-top
:
-10px
;
margin-top
:
-4%
;
margin-bottom
:
2px
margin-bottom
:
2px
;
width
:
80%
;
}
}
.login
{
.login
{
height
:
60px
;
height
:
60px
;
...
@@ -106,13 +107,9 @@
...
@@ -106,13 +107,9 @@
margin-top
:
-10
spx
;
margin-top
:
-10
spx
;
}
}
.input_with_image
input
:last-child
{
margin-left
:
10px
;
margin-top
:
-4px
;
margin-bottom
:
2px
}
body
{
.whole
{
margin
:
0
;
margin
:
0
;
padding
:
0
;
padding
:
0
;
background
:
url
(
'../../public/login_background1.png'
)
no-repeat
fixed
;
/* 배경 이미지 설정 */
background
:
url
(
'../../public/login_background1.png'
)
no-repeat
fixed
;
/* 배경 이미지 설정 */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment