fix
This commit is contained in:
@@ -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()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user