Ver Fonte

修复-去除菜单缓存后,刷新页面保留不了当前页面的问题

liyanyan há 1 semana atrás
pai
commit
512214697f
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      src/router/index.js

+ 2 - 2
src/router/index.js

@@ -1022,12 +1022,12 @@ router.beforeEach(async (to,
         //获取路由菜单
         menu.getMenu().then(response => {
           //保险起见,组装一次数据
-          // menu.parseRoute(JSON.parse(sessionStorage.getItem("route")), []).then(res => {
+          menu.parseRoute(store.state.user.menu, []).then(res => {
             //添加路由并进行跳转
             menu.addMenu(res).then(e => {
               next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
             })
-          // })
+          })
         }).catch(err => {//失败则直接跳转登录页面
           next(`/login`);
         })