Browse Source

未授权的情况

zhulizhen1111 5 years ago
parent
commit
15d353cf4d
3 changed files with 8 additions and 4 deletions
  1. 1 1
      src/framework/layout/layout-store.js
  2. 4 0
      src/utils/authutils.js
  3. 3 3
      src/views/system/auth/index.vue

+ 1 - 1
src/framework/layout/layout-store.js

@@ -91,7 +91,7 @@ export default {
                         }
                     } else {
                         state.userInfo = null
-                        authutils.toLoginPage()
+                       
                     }
                     resolve(resp)
                 })

+ 4 - 0
src/utils/authutils.js

@@ -57,6 +57,10 @@ export default {
             return true
         }
     },
+    toNoUser(){
+        console.log(this)
+        this.$router.replace('/nouser')
+    },
 
     getMenus(permissions) {
         let result = []

+ 3 - 3
src/views/system/auth/index.vue

@@ -25,9 +25,9 @@ export default {
                 console.log('last route ', lastRoute)
                 if (lastRoute) {
                     this.$router.replace(lastRoute)
-                } else {
-                    this.$router.replace('/nouser')
-                }
+                } 
+            }else{
+                this.$router.replace('/nouser')
             }
         })
     },