From a57d397245ff58136deaf089d8d544d07001b68b Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 2 Apr 2025 11:55:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(X-Pack):=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=BC=80=E5=90=AF=20MFA=20=E5=90=8E=E4=BD=BF=E7=94=A8=20CAS?= =?UTF-8?q?=E3=80=81OIDC=20=E6=97=A0=E6=B3=95=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/mobile/login/index.vue | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/views/mobile/login/index.vue b/core/core-frontend/src/views/mobile/login/index.vue index f1683a0b42..0e7be4e9bd 100644 --- a/core/core-frontend/src/views/mobile/login/index.vue +++ b/core/core-frontend/src/views/mobile/login/index.vue @@ -143,12 +143,7 @@ const onSubmit = async () => { return } showMfa.value = false - if (!isLdap && mfa?.enabled) { - for (const key in mfa) { - mfaData.value[key] = mfa[key] - } - showMfa.value = true - duringLogin.value = false + if (toMfa(mfa)) { return } userStore.setToken(token) @@ -177,6 +172,19 @@ const switchType = type => { const toMain = () => { router.push({ path: '/index' }) } +const toMfa = (mfa: any) => { + const isLdap = loginType.value === 'ldap' + if (!isLdap && mfa?.enabled) { + for (const key in mfa) { + mfaData.value[key] = mfa[key] + } + showMfa.value = true + duringLogin.value = false + showPlatLoginMask.value = false + return true + } + return false +} const loadFail = () => { xpackLoadFail.value = true showPlatLoginMask.value = false @@ -248,6 +256,7 @@ const loadFail = () => {