Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
RIT_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박권수
2021-09-18 04:20:18 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5ccb6d80ea06608c1c6f4f3b7f675137d22b0ff5
5ccb6d80
1 parent
9914ded6
feat. need to formdata file
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
web/src/api/api-auth.ts
web/src/views/register/RegisterContainer.tsx
web/src/api/api-auth.ts
View file @
5ccb6d8
import
{
client
}
from
"./client"
;
export
default
{
register
:
(
Data
:
any
)
=>
{
register
:
(
Data
:
FormData
)
=>
{
return
client
.
post
(
'/auth/register'
,
Data
);
},
...
...
web/src/views/register/RegisterContainer.tsx
View file @
5ccb6d8
...
...
@@ -26,7 +26,7 @@ const RegisterContainer = (props : RegisterProps) => {
password : '',
passwordCheck : '',
info : {
doctorLicense :
''
,
doctorLicense :
File
,
hospitalNm : '',
hospitalAddr : '',
contact : '',
...
...
@@ -225,9 +225,24 @@ const RegisterContainer = (props : RegisterProps) => {
} else if(page === 2) {
setPage(3);
} else if(page === 3) {
const Data = new FormData();
Data.append('userId', registerForm.userId);
Data.append('password', registerForm.password);
Data.append('passwordCheck', registerForm.passwordCheck);
Data.append('hospitalNm', registerForm.info.hospitalNm);
Data.append('hospitalAddr', registerForm.info.hospitalAddr);
Data.append('contact', registerForm.info.contact);
Data.append('doctorNm', registerForm.info.doctorNm);
Data.append('doctorType', registerForm.info.doctorType);
Data.append('doctorInfoFile', registerForm.info.doctorLicense[0]);
const onRegisterDoctor = async () => {
try {
const result = await authApi.registerDoctor(
registerForm
);
const result = await authApi.registerDoctor(
Data
);
if(result.data === 'Created') {
Alert.onSuccess('회원가입 성공, 관리자의 승인을 대기하세요.', () => props.history.push('/login'));
}
...
...
Please
register
or
login
to post a comment