xiaozy #2
@@ -6,13 +6,15 @@ import { obtainUrlPathParameterTarget } from '@/utils/index.js'
|
||||
import { getToken, removeToken } from '@/utils/auth'
|
||||
import { Notify } from 'vant'
|
||||
|
||||
let whiteList = ['/home']
|
||||
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
//pinia挂载顺序问题异步处理路由拦截
|
||||
setTimeout(() => {
|
||||
let store = useStore() //获取状态
|
||||
let token = getToken() //获取cookie
|
||||
// removeToken()
|
||||
// store.getPosition()
|
||||
!whiteList.includes(to.path) && store.getPosition()
|
||||
|
||||
if (!token) {
|
||||
let paramsTarget = obtainUrlPathParameterTarget(location.href)
|
||||
|
||||
Reference in New Issue
Block a user