feat: 登录接口错误信息码调整

This commit is contained in:
rd
2025-09-08 17:36:25 +08:00
parent b8a58091ad
commit 8597ad67f0
3 changed files with 17 additions and 10 deletions

View File

@ -303,6 +303,12 @@ const handleSubmit = async () => {
const _fn = isCaptchaLogin.value ? fetchAuthorizationsCaptcha : postLoginPassword;
const { code, data, message: errorInfo } = await _fn(loginForm);
console.log(code, errorInfo);
if (code === 10001) {
errMsg.value = errorInfo;
return;
}
if (code === 200) {
// 处理登录成功逻辑
message.success('登录成功');
@ -318,10 +324,6 @@ const handleSubmit = async () => {
getProfileInfo();
}
} catch (error) {
if (error?.status === 400) {
errMsg.value = error.data?.message;
}
} finally {
submitting.value = false;
}