perf: 登录顺序

This commit is contained in:
archer
2023-03-06 20:40:10 +08:00
parent dd5217d8a5
commit 16775430ea
7 changed files with 415 additions and 242 deletions

View File

@@ -50,10 +50,6 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
async ({ email, password, code }: RegisterType) => {
setRequesting(true);
try {
toast({
title: `注册成功`,
status: 'success'
});
loginSuccess(
await postRegister({
email,
@@ -61,6 +57,10 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
password
})
);
toast({
title: `注册成功`,
status: 'success'
});
} catch (error) {
typeof error === 'string' &&
toast({