This commit is contained in:
zhutianqi
2021-09-06 11:11:30 +08:00
parent 7b390d4c89
commit c9e0ae673a
-2
View File
@@ -2066,10 +2066,8 @@ router.onError((error) => {
}) })
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
console.log(111);
let toName = to.name let toName = to.name
let token = store.state.token let token = store.state.token
console.log(toName);
// 返回值为登录状态 // 返回值为登录状态
if ((token === null || token === '') && (toName !== 'Login' && to.meta.requireAuth)) { if ((token === null || token === '') && (toName !== 'Login' && to.meta.requireAuth)) {
return next('/Login') return next('/Login')