feat(auth): support local username login mode

This commit is contained in:
mac
2026-07-16 16:19:25 +08:00
parent d5c7cab8bb
commit cafa8bc840
10 changed files with 304 additions and 19 deletions
+7 -1
View File
@@ -4,6 +4,7 @@
<script setup lang="ts">
import { onMounted } from 'vue'
import { authApi } from '@/api/auth'
import { getToken } from '@/utils/auth'
import { redirectToSSO } from '@/utils/sso'
import { useAuthStore } from '@/stores/auth'
@@ -20,7 +21,12 @@ onMounted(async () => {
await authStore.refreshUser()
} catch {
authStore.clearAuth()
redirectToSSO()
const { data } = await authApi.getConfig()
if (data.sso_enabled) {
redirectToSSO()
} else {
window.location.assign('/login')
}
}
})
</script>