diff --git a/pangu-ui/src/views/login/index.vue b/pangu-ui/src/views/login/index.vue index a7214e0..04145c3 100644 --- a/pangu-ui/src/views/login/index.vue +++ b/pangu-ui/src/views/login/index.vue @@ -30,7 +30,7 @@ /> - +
{ try { const res = await request.get('/api/captchaImage') if (res.code === 200) { - captchaImg.value = res.data.img - uuid.value = res.data.uuid - // 如果验证码未启用,设置验证规则为非必填 - if (!res.data.captchaEnabled) { + captchaEnabled.value = res.data.captchaEnabled + if (captchaEnabled.value) { + captchaImg.value = res.data.img + uuid.value = res.data.uuid + loginRules.code[0].required = true + } else { + // 验证码未启用,设置为非必填 loginRules.code[0].required = false } }