linwenxin hai 5 meses
pai
achega
0ee579a2ad
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/permission.js

+ 3 - 1
src/permission.js

@@ -46,7 +46,9 @@ router.beforeEach(async (to, from, next) => {
           await store.dispatch('user/getRouter')
           if (store.getters.menus.length < 1) {
             global.antRouter = []
-            next()
+            await store.dispatch('user/logout')
+            store.commit('tagsView/SET_RESET_VIES')
+            next({ path: '/login' })
           }
           var userInfo = JSON.parse(localStorage.getItem('greemall_user'))
           var moduleObj = {