mirror of https://gitee.com/stylefeng/roses
【7.2.5】【role】更新角色绑定菜单权限接口
parent
42643a0618
commit
6a3efaa7b6
|
@ -191,12 +191,14 @@ public class AntdMenusFactory {
|
|||
// 先转化第一层级的菜单
|
||||
List<MenuAndButtonTreeResponse> menuAndButtonTreeResponses = parseMenuAndButtonTreeResponse(sysMenuList, roleBindMenus);
|
||||
|
||||
// 转化菜单的子集
|
||||
// 遍历所有菜单,查看是否有二级菜单
|
||||
for (SysMenu sysMenu : sysMenuList) {
|
||||
|
||||
// 如果存在二级菜单,则继续进行转化
|
||||
if (ObjectUtil.isNotEmpty(sysMenu.getChildren())) {
|
||||
for (MenuAndButtonTreeResponse menuAndButtonTreeRespons : menuAndButtonTreeResponses) {
|
||||
if (sysMenu.getMenuId().equals(menuAndButtonTreeRespons.getId())) {
|
||||
List<MenuAndButtonTreeResponse> subLevelItems = parseMenuAndButtonTreeResponse(sysMenuList, roleBindMenus);
|
||||
List<MenuAndButtonTreeResponse> subLevelItems = parseMenuAndButtonTreeResponse(sysMenu.getChildren(), roleBindMenus);
|
||||
menuAndButtonTreeRespons.setChildren(subLevelItems);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -517,7 +517,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||
}
|
||||
|
||||
// 将组装好的一级菜单和里边的children都转化为响应对象,并填充checked标识
|
||||
return AntdMenusFactory.parseMenuAndButtonTreeResponseWithChildren(sysMenuList, roleMenuList);
|
||||
return AntdMenusFactory.parseMenuAndButtonTreeResponseWithChildren(ListUtil.toList(firstLevelMenus.values()), roleMenuList);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue