quwangxin 2 лет назад
Родитель
Сommit
ee9127c20b
1 измененных файлов с 11 добавлено и 9 удалено
  1. 11 9
      src/store/modules/user.js

+ 11 - 9
src/store/modules/user.js

@@ -18,17 +18,19 @@ const formatRouter = (list) => {
       }
       p.component = '';
       if (p.menuType === 2) {
-        p.children = [];
-        authorities.push(p);
+        // p.children = [];
+        // authorities.push(p);
+        p.hide = true;
+      }
+      // else {
+      if (p.children?.length) {
+        p.children = fn(p.children, curPath);
       } else {
-        if (p.children?.length) {
-          p.children = fn(p.children, curPath);
-        } else {
-          p.children = [];
-        }
-
-        arr.push(p);
+        p.children = [];
       }
+
+      arr.push(p);
+      // }
     }
 
     return arr;