refactor: streamline loading state handling and update login endpoint case

This commit is contained in:
wxg0103 2025-10-14 16:52:27 +08:00
parent dea6702cca
commit fca42666a3
2 changed files with 2 additions and 4 deletions

View File

@ -22,7 +22,7 @@ const ldapLogin: (request: LoginRequest, loading?: Ref<boolean>) => Promise<Resu
request,
loading
) => {
return post('/ldap/login', request, undefined, loading)
return post('/LDAP/login', request, undefined, loading)
}
/**
*

View File

@ -283,9 +283,7 @@ const login = () => {
locale.value = localStorage.getItem('MaxKB-locale') || getBrowserLang() || 'en-US'
router.push({ name: 'home' })
})
.catch(() => {
loading.value = false
})
.finally(() => (loading.value = false))
} else {
const publicKey = forge.pki.publicKeyFromPem(user.rasKey)
const encrypted = publicKey.encrypt(JSON.stringify(loginForm.value), 'RSAES-PKCS1-V1_5')