修改客户端路由配置

This commit is contained in:
龙运模 2024-11-25 22:59:59 +08:00
parent feb5693789
commit aaaa9028f0

View File

@ -47,14 +47,17 @@ router.beforeEach(async (to, from, next) => {
next();
return false;
}
// console.log(routes,to,6999)
if(routes.findIndex(r => r.path === to.path) >= 0){
// if(to.toShow && !token){
// next({
// path: '/login'
// });
// return false;
// }
routes.forEach(item=>{
if(item.tokenShow && item.path === to.path){
if(!token){
next({
path: '/login'
});
return false;
}
}
})
next();
return false;
}