|
|
@ -140,7 +140,7 @@ |
|
|
|
{{ $t('commons.login.errorAuthInfo') }} |
|
|
|
{{ $t('commons.login.errorAuthInfo') }} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="captcha" class="login-captcha"> |
|
|
|
<el-form-item v-if="!globalStore.ignoreCaptcha" prop="captcha" class="login-captcha"> |
|
|
|
<el-input v-model.trim="loginForm.captcha" :placeholder="$t('commons.login.captchaHelper')"> |
|
|
|
<el-input v-model.trim="loginForm.captcha" :placeholder="$t('commons.login.captchaHelper')"> |
|
|
|
<template #prefix> |
|
|
|
<template #prefix> |
|
|
|
<svg-icon style="font-size: 7px" iconName="p-yanzhengma1"></svg-icon> |
|
|
|
<svg-icon style="font-size: 7px" iconName="p-yanzhengma1"></svg-icon> |
|
|
@ -239,6 +239,7 @@ const loginFormRef = ref<FormInstance>(); |
|
|
|
const loginForm = reactive({ |
|
|
|
const loginForm = reactive({ |
|
|
|
name: '', |
|
|
|
name: '', |
|
|
|
password: '', |
|
|
|
password: '', |
|
|
|
|
|
|
|
ignoreCaptcha: true, |
|
|
|
captcha: '', |
|
|
|
captcha: '', |
|
|
|
captchaID: '', |
|
|
|
captchaID: '', |
|
|
|
authMethod: '', |
|
|
|
authMethod: '', |
|
|
@ -286,11 +287,12 @@ const login = (formEl: FormInstance | undefined) => { |
|
|
|
let requestLoginForm = { |
|
|
|
let requestLoginForm = { |
|
|
|
name: loginForm.name, |
|
|
|
name: loginForm.name, |
|
|
|
password: loginForm.password, |
|
|
|
password: loginForm.password, |
|
|
|
|
|
|
|
ignoreCaptcha: globalStore.ignoreCaptcha, |
|
|
|
captcha: loginForm.captcha, |
|
|
|
captcha: loginForm.captcha, |
|
|
|
captchaID: captcha.captchaID, |
|
|
|
captchaID: captcha.captchaID, |
|
|
|
authMethod: '', |
|
|
|
authMethod: '', |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (requestLoginForm.captcha == '') { |
|
|
|
if (!globalStore.ignoreCaptcha && requestLoginForm.captcha == '') { |
|
|
|
errCaptcha.value = true; |
|
|
|
errCaptcha.value = true; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -308,12 +310,14 @@ const login = (formEl: FormInstance | undefined) => { |
|
|
|
errAuthInfo.value = false; |
|
|
|
errAuthInfo.value = false; |
|
|
|
} |
|
|
|
} |
|
|
|
if (res.message === 'ErrAuth') { |
|
|
|
if (res.message === 'ErrAuth') { |
|
|
|
|
|
|
|
globalStore.ignoreCaptcha = false; |
|
|
|
errCaptcha.value = false; |
|
|
|
errCaptcha.value = false; |
|
|
|
errAuthInfo.value = true; |
|
|
|
errAuthInfo.value = true; |
|
|
|
} |
|
|
|
} |
|
|
|
loginVerify(); |
|
|
|
loginVerify(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
globalStore.ignoreCaptcha = true; |
|
|
|
if (res.data.mfaStatus === 'enable') { |
|
|
|
if (res.data.mfaStatus === 'enable') { |
|
|
|
mfaShow.value = true; |
|
|
|
mfaShow.value = true; |
|
|
|
errMfaInfo.value = false; |
|
|
|
errMfaInfo.value = false; |
|
|
|