Explorar o código

'修复beforEnter死循环'

lin-xin %!s(int64=7) %!d(string=hai) anos
pai
achega
fa98640a36
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/main.js

+ 1 - 1
src/main.js

@@ -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){
         // 如果是管理员权限则可进入,这里只是简单的模拟管理员权限而已