refactor(frontend): merge authserver web login

This commit is contained in:
mac
2026-07-15 14:47:42 +08:00
parent 6af511ed0b
commit 81d2a8a60b
23 changed files with 178 additions and 1115 deletions
+4 -1
View File
@@ -1,5 +1,6 @@
import { createRouter, createWebHistory } from 'vue-router'
import { getToken } from '@/utils/auth'
import { consumeSSOToken, redirectToSSO } from '@/utils/sso'
const router = createRouter({
history: createWebHistory(),
@@ -98,10 +99,12 @@ const router = createRouter({
// 路由守卫
router.beforeEach((to, _from, next) => {
consumeSSOToken()
const token = getToken()
if (to.meta.requiresAuth !== false && !token) {
next('/login')
redirectToSSO()
return
} else if (to.path === '/login' && token) {
next('/')
} else {