Skip to content

Commit

Permalink
update: update apis for rust server
Browse files Browse the repository at this point in the history
  • Loading branch information
zrll12 committed Feb 19, 2024
1 parent 90d65d2 commit 803d4aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
7 changes: 1 addition & 6 deletions app/authenticate/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,11 @@ export default function Page(){
username: userName,
code
})
.then((
{data: [status, message]}
) => {
if (status) {
.then(() => {
Message.success('注册成功, 请登录');
setPageType('login');
setPassword('');
return;
}
Message.error(message)
})
.finally(() => setLoading(false));
}
Expand Down
2 changes: 1 addition & 1 deletion interface/userAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ export class UserAPI {
return [false, "登录错误:" + e];
}
}
}
}
6 changes: 1 addition & 5 deletions providers/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ export class User {
}

async createUser(data: RegisterRequestData) {
const formData = new FormData();
for (const [key, value] of Object.entries(data)) {
formData.append(key, value);
}
return this.axios.postForm<[Boolean, string]>('/user', formData);
return this.axios.post<[Boolean, string]>('/user', data);
}

async login(data: LoginData) {
Expand Down

0 comments on commit 803d4aa

Please sign in to comment.