Jelajahi Sumber

fix 修复 五级路由缓存无效问题

疯狂的狮子Li 1 tahun lalu
induk
melakukan
9b68b27168

+ 4 - 0
ruoyi-ui-vue3/src/store/modules/permission.js

@@ -101,6 +101,10 @@ function filterChildren(childrenMap, lastRouter = false) {
     }
     if (lastRouter) {
       el.path = lastRouter.path + '/' + el.path
+      if (el.children && el.children.length) {
+        children = children.concat(filterChildren(el.children, el))
+        return
+      }
     }
     children = children.concat(el)
   })

+ 4 - 0
ruoyi-ui/src/store/modules/permission.js

@@ -98,6 +98,10 @@ function filterChildren(childrenMap, lastRouter = false) {
     }
     if (lastRouter) {
       el.path = lastRouter.path + '/' + el.path
+      if (el.children && el.children.length) {
+        children = children.concat(filterChildren(el.children, el))
+        return
+      }
     }
     children = children.concat(el)
   })