这样没用 - -
应该需要怎么加?
router.beforeEach((to, from, next) => {
if (!checkJs.getCookie('token') && to.path !== '/' && to.path !== '/resetpassword') {next('/');
} else if (checkJs.getCookie('token') && from.path === '/login' || checkJs.getCookie('token') && to.path === '/'){next({
path: '/market'
});
}else if(!navigator.onLine&&to.path!=='/notFoundPage'){next({
path: '/notFoundPage'
});
} else {store.state.global.blankPage=false;
store.state.global.footerhide=true;
next();
}
})
需要在里面加吗
求列子。。