Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
client-user
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
한성재
client-user
Commits
04945a00
Commit
04945a00
authored
1 year ago
by
한성재
Committed by
Minseo Lee
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
feat: signuppage connect api
parent
989c1386
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pages/signup-page/SignupPage.tsx
+32
-27
32 additions, 27 deletions
src/pages/signup-page/SignupPage.tsx
with
32 additions
and
27 deletions
src/pages/signup-page/SignupPage.tsx
+
32
−
27
View file @
04945a00
...
@@ -21,7 +21,7 @@ interface Props {
...
@@ -21,7 +21,7 @@ interface Props {
const
SignupPage
:
React
.
FC
<
Props
>
=
({
connector
})
=>
{
const
SignupPage
:
React
.
FC
<
Props
>
=
({
connector
})
=>
{
const
navigate
=
useNavigate
();
const
navigate
=
useNavigate
();
const
[
acountData
,
setAcountData
]
=
useState
({
const
[
ac
c
ountData
,
setAc
c
ountData
]
=
useState
({
loginId
:
''
,
loginId
:
''
,
name
:
''
,
name
:
''
,
password
:
''
,
password
:
''
,
...
@@ -30,8 +30,8 @@ const SignupPage: React.FC<Props> = ({ connector }) => {
...
@@ -30,8 +30,8 @@ const SignupPage: React.FC<Props> = ({ connector }) => {
});
});
const
[
passwordAgain
,
setPasswordAgain
]
=
useState
<
string
>
(
''
);
const
[
passwordAgain
,
setPasswordAgain
]
=
useState
<
string
>
(
''
);
const
Correct
=
()
=>
{
const
Correct
=
()
=>
{
const
empty
=
acountData
.
password
===
''
;
const
empty
=
ac
c
ountData
.
password
===
''
;
const
same
=
acountData
.
password
===
passwordAgain
;
const
same
=
ac
c
ountData
.
password
===
passwordAgain
;
if
(
empty
)
{
if
(
empty
)
{
return
null
;
return
null
;
}
}
...
@@ -43,32 +43,34 @@ const SignupPage: React.FC<Props> = ({ connector }) => {
...
@@ -43,32 +43,34 @@ const SignupPage: React.FC<Props> = ({ connector }) => {
</
div
>
</
div
>
);
);
};
};
const
handleNameChange
=
(
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
const
handleNameChange
=
(
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
setAcountData
((
prev
)
=>
({
setAc
c
ountData
((
prev
)
=>
({
...
prev
,
...
prev
,
name
:
event
.
target
.
value
name
:
event
.
target
.
value
}));
}));
};
};
const
handleIdChange
=
(
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
const
handleIdChange
=
(
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
setAcountData
((
prev
)
=>
({
setAc
c
ountData
((
prev
)
=>
({
...
prev
,
...
prev
,
loginId
:
event
.
target
.
value
loginId
:
event
.
target
.
value
}));
}));
};
};
const
handleEmailChange
=
(
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
const
handleEmailChange
=
(
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
setAcountData
((
prev
)
=>
({
setAc
c
ountData
((
prev
)
=>
({
...
prev
,
...
prev
,
email
:
event
.
target
.
value
email
:
event
.
target
.
value
}));
}));
};
};
const
handlePhoneChange
=
(
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
const
handlePhoneChange
=
(
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
setAcountData
((
prev
)
=>
({
setAc
c
ountData
((
prev
)
=>
({
...
prev
,
...
prev
,
phone
:
event
.
target
.
value
phone
:
event
.
target
.
value
}));
}));
};
};
const
handlePasswordChange
=
(
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
const
handlePasswordChange
=
(
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
setAcountData
((
prev
)
=>
({
setAc
c
ountData
((
prev
)
=>
({
...
prev
,
...
prev
,
password
:
event
.
target
.
value
password
:
event
.
target
.
value
}));
}));
...
@@ -78,24 +80,27 @@ const SignupPage: React.FC<Props> = ({ connector }) => {
...
@@ -78,24 +80,27 @@ const SignupPage: React.FC<Props> = ({ connector }) => {
};
};
const
handleSignup
=
()
=>
{
const
handleSignup
=
()
=>
{
if
(
accountData
.
loginId
!==
''
&&
accountData
.
name
!==
''
&&
accountData
.
email
!==
''
&&
accountData
.
phone
!==
''
&&
accountData
.
password
!==
''
&&
passwordAgain
!==
''
){
try
{
void
(
async
()
=>
{
void
(
async
()
=>
{
await
connector
.
post
(
'
/user/register
'
,
{
await
fetchData
(
'
/user/register
'
,
FETCH_METHOD
.
POST
,
accountData
);
loginId
:
'
asdf
'
,
name
:
'
asdf
'
,
password
:
'
asdf
'
,
email
:
'
asdf@asdf.com
'
,
phone
:
'
010-1234-1234
'
});
navigate
(
APP_ROUTE
.
LOGIN
);
navigate
(
APP_ROUTE
.
LOGIN
);
})();
})();
// fetchData('/user/register', FETCH_METHOD.POST, setIsLogin,
{
}
catch
(
e
)
{
//
loginId: 'asdf',
console
.
error
(
e
);
//
name: 'ms',
}
// password: 'asdf',
}
// email: 'asdf@asdf.com',
else
{
//
phone: '010-1234-1234'
alert
(
'
모든 정보를 입력해주세요
'
);
// });
}
// navigate(APP_ROUTE.LOGIN);
};
};
return
(
return
(
...
@@ -106,7 +111,7 @@ const SignupPage: React.FC<Props> = ({ connector }) => {
...
@@ -106,7 +111,7 @@ const SignupPage: React.FC<Props> = ({ connector }) => {
<
input
placeholder
=
{
'
전화번호
'
}
onChange
=
{
handlePhoneChange
}
/>
<
input
placeholder
=
{
'
전화번호
'
}
onChange
=
{
handlePhoneChange
}
/>
<
input
<
input
placeholder
=
{
'
비밀번호를 입력해주세요.
'
}
placeholder
=
{
'
비밀번호를 입력해주세요.
'
}
value
=
{
acountData
.
password
}
value
=
{
ac
c
ountData
.
password
}
onChange
=
{
handlePasswordChange
}
onChange
=
{
handlePasswordChange
}
type
=
{
'
password
'
}
type
=
{
'
password
'
}
/>
/>
...
...
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