路由修改

This commit is contained in:
zoujiandong 2023-07-21 13:06:16 +08:00
parent e0766092b8
commit d7db3c234f

View File

@ -89,11 +89,17 @@ router.beforeEach(async(to, from, next) => {
}else if(to.name == 'login' && store.token && permissionStore.addRouters.length>0){ }else if(to.name == 'login' && store.token && permissionStore.addRouters.length>0){
const menuList= permissionStore.menuList; const menuList= permissionStore.menuList;
next({ path: menuList[0].children[0].path }); next({ path: menuList[0].children[0].path });
} else {
if(to.path=="/" || to.path=="/admin"){
const menuList= permissionStore.menuList;
next({ path: menuList[0].children[0].path });
}else{ }else{
next(); next();
} }
} }
}
}); });
// afterEach Router // afterEach Router