refactor: update login mode handling and simplify QR code tab logic

This commit is contained in:
wxg0103 2025-08-06 11:44:48 +08:00
parent e4575389eb
commit 885b65cbbe

View File

@ -346,7 +346,7 @@ function redirectAuth(authType: string, needMessage: boolean = false) {
} }
function changeMode(val: string) { function changeMode(val: string) {
loginMode.value = val === 'LDAP' ? val : 'LOCAL' loginMode.value = val === 'LDAP' ? val : ''
if (val === 'QR_CODE') { if (val === 'QR_CODE') {
loginMode.value = val loginMode.value = val
showQrCodeTab.value = true showQrCodeTab.value = true
@ -396,11 +396,8 @@ onBeforeMount(() => {
: t('views.system.authentication.scanTheQRCode.lark'), : t('views.system.authentication.scanTheQRCode.lark'),
}) })
}) })
if (modeList.value.length === 0) { showQrCodeTab.value = true
showQrCodeTab.value = true modeList.value = ['QR_CODE', ...modeList.value]
} else {
modeList.value = ['QR_CODE', ...modeList.value]
}
} }
} }
}) })