fix(X-Pack): 移动端开启 MFA 后使用 CAS、OIDC 无法登录

This commit is contained in:
fit2cloud-chenyw
2025-04-02 11:55:30 +08:00
committed by fit2cloud-chenyw
parent d189ab8d00
commit a57d397245

View File

@@ -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 = () => {
<XpackComponent
jsname="L2NvbXBvbmVudC9sb2dpbi9Nb2JpbGVIYW5kbGVy"
@switch-type="switchType"
@to-mfa="toMfa"
@to-main="toMain"
/>
</div>