'修复beforEnter死循环'

pull/80/head
lin-xin 2018-04-23 20:28:31 +08:00
parent 7edde21472
commit fa98640a36
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ Vue.prototype.$axios = axios;
//使用钩子函数对路由进行权限跳转
router.beforeEach((to, from, next) => {
const role = localStorage.getItem('ms_username');
if(!role){
if(!role && to.path !== '/login'){
next('/login');
}else if(to.meta.permission){
// 如果是管理员权限则可进入,这里只是简单的模拟管理员权限而已