This commit is contained in:
Zyronon
2025-11-11 11:47:59 +00:00
parent f502e2d713
commit bf589dce92
14 changed files with 662 additions and 732 deletions

View File

@@ -63,6 +63,8 @@ const router = VueRouter.createRouter({
// 路由守卫
router.beforeEach(async (to: any, from: any) => {
return true
const authStore = useAuthStore()
// 公共路由,不需要登录验证
@@ -78,7 +80,7 @@ router.beforeEach(async (to: any, from: any) => {
// 尝试初始化认证状态
const isInitialized = await authStore.initAuth()
if (!isInitialized) {
return { path: '/login', query: { redirect: to.fullPath } }
return {path: '/login', query: {redirect: to.fullPath}}
}
}