pull/2/head
xiaozhiyong 2 years ago
parent 493ab7bace
commit ee6ebb71f1
  1. 4
      src/permission.js

@ -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)

Loading…
Cancel
Save