| | |
| | | Set<Long> menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId)); |
| | | List<MenuDO> menuList = menuService.getMenuList(menuIds); |
| | | menuList = menuService.filterDisableMenus(menuList); |
| | | // menuList = menuService.filterMenus(menuList, "system"); |
| | | menuList = menuService.filterMenus(menuList, "system"); |
| | | |
| | | // 2. 拼接结果返回 |
| | | return success(AuthConvert.INSTANCE.convert(user, roles, menuList)); |
| | |
| | | } |
| | | children.retainAll(menuList); |
| | | List<MenuDO> tempChildren = new LinkedList<>(); |
| | | //为每一个二级菜单增加一个隐藏父级目录 |
| | | //为每一个二级菜单(非外链菜单)增加一个隐藏父级目录 |
| | | children.stream().forEach(menu -> { |
| | | if (menu.getParentId().equals(menuDO.getId())) { |
| | | if(menu.getType().equals(MenuTypeEnum.MENU.getType())) { |
| | |
| | | tempChildren.add(parentMenu); |
| | | } else if(menu.getType().equals(MenuTypeEnum.DIR.getType())) { |
| | | // 为应用菜单二级目录前增加“/” |
| | | if(!menu.getPath().contains("http:") && !menu.getPath().contains("https:")) { |
| | | menu.setPath("/" + menu.getPath()); |
| | | } |
| | | } |
| | | } |
| | | tempChildren.add(menu); |
| | | }); |
| | | menuVOS = AuthConvert.INSTANCE.buildMenuTree(tempChildren, menuDO.getId(), menuDO.getPath(), info.getType()); |