linwenxin hace 5 meses
padre
commit
8e79a3061b
Se han modificado 2 ficheros con 6 adiciones y 2 borrados
  1. 6 0
      src/permission.js
  2. 0 2
      src/store/modules/user.js

+ 6 - 0
src/permission.js

@@ -46,6 +46,12 @@ router.beforeEach(async (to, from, next) => {
           await store.dispatch('user/getRouter')
           if (store.getters.menus.length < 1) {
             global.antRouter = []
+            Message.error('没有分配任何页面')
+            await new Promise(r => {
+              setTimeout(() => {
+                r()
+              }, 1500)
+            })
             await store.dispatch('user/logout')
             store.commit('tagsView/SET_RESET_VIES')
             next({ path: '/login' })

+ 0 - 2
src/store/modules/user.js

@@ -273,8 +273,6 @@ const actions = {
           // 页面并清除当前页面的history记录
           window.history.replaceState(null, '', '')
           window.history.go(0)
-          // commit('RESET_STATE')
-          // resolve()
         })
         .catch(error => {
           reject(error)