Przeglądaj źródła

修改权限处理和路由隐藏逻辑

yusheng 9 miesięcy temu
rodzic
commit
aff1a28057
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/store/modules/user.js

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

@@ -15,8 +15,8 @@ const formatRouter = (list) => {
     let arr = [];
     for (const p of list) {
       if (p.menuType === 2) {
-        p.children = [];
         authorities.push(p);
+        p.hide = true;
       } else {
         //报表菜单 source = 2 为报表时 extend 为报表id
         if (p.source === 2 && p.extend) {
@@ -68,7 +68,7 @@ export default {
     },
     // 设置登录用户的权限
     setAuthorities(state, authorities) {
-      state.authorities = authorities;
+      state.authorities = authorities.map((item) => item.permissionCode);
     },
     // 设置登录用户的权限路由
     setAuthoritiesRouter(state, authoritiesRouter) {