修复BUG:

1.验证码输入错误不刷新问题
This commit is contained in:
猿小天
2023-12-24 11:04:28 +08:00
parent ba4a580bb0
commit 2826cafa75
2 changed files with 6 additions and 5 deletions

View File

@@ -102,7 +102,7 @@ function createService() {
errorCreate(`${dataAxios.msg}: ${response.config.url}`);
break;
}
return Promise.reject();
return Promise.reject(dataAxios);
}
},
(error) => {

View File

@@ -126,6 +126,7 @@ export default defineComponent({
});
};
const refreshCaptcha = async () => {
state.ruleForm.captcha=''
loginApi.getCaptcha().then((ret: any) => {
state.ruleForm.captchaImgBase = ret.data.image_base;
state.ruleForm.captchaKey = ret.data.key;
@@ -150,11 +151,11 @@ export default defineComponent({
// 执行完 initBackEndControlRoutes再执行 signInSuccess
loginSuccess();
}
} else if (res.code === 4000) {
// 登录错误之后,刷新验证码
refreshCaptcha();
}
});
}).catch((err: any) => {
// 登录错误之后,刷新验证码
refreshCaptcha();
});
} else {
errorMessage("请填写登录信息")
}