ly há 1 mês atrás
pai
commit
9219d869c1
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      ui/src/permission.js

+ 3 - 0
ui/src/permission.js

@@ -10,6 +10,9 @@ NProgress.configure({ showSpinner: false })
 const whiteList = ['/login','/socialLogin', '/azureLogin', '/auth-redirect', '/bind', '/register']
 
 router.beforeEach((to, from, next) => {
+  if (to.matched && to.matched.length > 2) { // 解决:若依三级菜单不缓存
+    to.matched.splice(1, to.matched.length - 2)
+  }
   NProgress.start()
   if (from.meta.keepAlive) {
     const $content = document.querySelector('.menuTable > .el-table__body-wrapper');