feat: 错误提示

This commit is contained in:
Archer
2023-03-10 19:44:06 +08:00
parent 453f3be8ce
commit 38d49ea05f
10 changed files with 45 additions and 40 deletions

View File

@@ -61,13 +61,11 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
title: `密码已找回`,
status: 'success'
});
} catch (error) {
typeof error === 'string' &&
toast({
title: error,
status: 'error',
position: 'top'
});
} catch (error: any) {
toast({
title: error.message || '修改密码异常',
status: 'error'
});
}
setRequesting(false);
},

View File

@@ -42,13 +42,11 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
title: '登录成功',
status: 'success'
});
} catch (error) {
typeof error === 'string' &&
toast({
title: error,
status: 'error',
position: 'top'
});
} catch (error: any) {
toast({
title: error.message || '登录异常',
status: 'error'
});
}
setRequesting(false);
},

View File

@@ -61,14 +61,11 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
title: `注册成功`,
status: 'success'
});
} catch (error) {
typeof error === 'string' &&
toast({
title: error,
status: 'error',
duration: 4000,
isClosable: true
});
} catch (error: any) {
toast({
title: error.message || '注册异常',
status: 'error'
});
}
setRequesting(false);
},