lilei 3 anni fa
parent
commit
85b34edd10
1 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  1. 6 3
      src/permission.js

+ 6 - 3
src/permission.js

@@ -45,7 +45,8 @@ router.beforeEach((to, from, next) => {
             if (roles.permissionList.length == 0 || !roles) {
               store.dispatch('Logout').then(() => {
                 store.dispatch('ResetRoutes').then(() => {
-                  next({ path: '/user/login', query: { redirect: to.fullPath } })
+                  // next({ path: '/user/login', query: { redirect: to.fullPath } })
+                  next({ path: '/user/login' })
                 })
               })
             } else {
@@ -70,7 +71,8 @@ router.beforeEach((to, from, next) => {
               description: '请求用户信息失败,请重试'
             })
             store.dispatch('Logout').then(() => {
-              next({ path: '/user/login', query: { redirect: to.fullPath } })
+              // next({ path: '/user/login', query: { redirect: to.fullPath } })
+              next({ path: '/user/login' })
             })
           })
       } else {
@@ -83,7 +85,8 @@ router.beforeEach((to, from, next) => {
       // 在免登录白名单,直接进入
       next()
     } else {
-      next({ path: '/user/login', query: { redirect: to.fullPath } })
+      // next({ path: '/user/login', query: { redirect: to.fullPath } })
+      next({ path: '/user/login' })
       NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
     }
   }