Skip to content

Commit fa98640

Browse files
committed
'修复beforEnter死循环'
1 parent 7edde21 commit fa98640

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.js

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

0 commit comments

Comments
 (0)