Browse Source

修改判断

lex-xin 4 years ago
parent
commit
5038bd2450
2 changed files with 1 additions and 4 deletions
  1. 1 0
      src/layout/components/Navbar.vue
  2. 0 4
      src/permission.js

+ 1 - 0
src/layout/components/Navbar.vue

@@ -177,6 +177,7 @@ export default {
     },
     async logout() {
       await this.$store.dispatch("user/logout");
+      localStorage.removeItem('firstMenu')
       // await this.$store.dispatch("permission/removePermission")
       this.$router.push(`/login`);
       window.location.reload();

+ 0 - 4
src/permission.js

@@ -47,10 +47,6 @@ function getFirstMenu(routes) {
           firstMenu = item.path + '/' + child.path
         }
       })
-    } else {
-      if(!firstMenu) {
-        firstMenu = item.path
-      }
     }
   })
   return firstMenu