fix: 使用常量替代验证码成功返回码,并添加验证码文本处理

This commit is contained in:
TsMask
2025-03-31 19:00:04 +08:00
parent 6093a234cc
commit c72f0290fd

View File

@@ -77,7 +77,7 @@ function fnGetCaptcha() {
state.captchaClick = true; state.captchaClick = true;
getCaptchaImage().then(res => { getCaptchaImage().then(res => {
state.captchaClick = false; state.captchaClick = false;
if (res.code != 1) { if (res.code != RESULT_CODE_SUCCESS) {
message.warning(`${res.msg}`, 3); message.warning(`${res.msg}`, 3);
return; return;
} }
@@ -85,6 +85,9 @@ function fnGetCaptcha() {
if (state.captcha.enabled) { if (state.captcha.enabled) {
state.captcha.codeImg = res.img; state.captcha.codeImg = res.img;
state.from.uuid = res.uuid; state.from.uuid = res.uuid;
if (res.text) {
state.from.code = res.text;
}
} }
}); });
} }