This commit is contained in:
lzp
2026-03-03 15:39:54 +08:00
parent 76afe1022f
commit b3b7ce2f2a
15 changed files with 141 additions and 46 deletions

View File

@@ -1,7 +1,11 @@
import router from './index'
import { useGlobalStore } from '@/stores/global'
import { useGlobalStore, useUserInfoStore } from '@/stores'
router.beforeEach((to, from, next) => {
if (!to.meta.notToken && !useUserInfoStore().state.token) {
return next({ name: 'login' })
}
useGlobalStore().setViewLoading(true)
next()
})