diff --git a/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/controller/ResourceController.java b/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/controller/ResourceController.java index 3638b736a..cde439885 100644 --- a/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/controller/ResourceController.java +++ b/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/controller/ResourceController.java @@ -53,25 +53,25 @@ public class ResourceController { } /** - * 获取资源平级树列表,用于分配接口权限(适用于layui版本) + * Layui版本--获取资源树列表,用于角色分配接口权限 * * @author majianguo * @date 2021/1/9 15:07 */ - @GetResource(name = "获取资源平级树列表,用于分配接口权限", path = "/resource/getLateralTree") + @GetResource(name = "Layui版本--获取资源树列表,用于角色分配接口权限", path = "/resource/getRoleResourceTree") public List getLateralTree(SysRoleRequest sysRoleRequest) { - return sysResourceService.getResourceTree(sysRoleRequest.getRoleId(), true); + return sysResourceService.getResourceTree(sysRoleRequest.getRoleId(), false); } /** - * 获取资源树列表,用于分配接口权限(适用于antd vue版本) + * AntdVue版本--获取资源树列表,用于角色分配接口权限 * * @author majianguo * @date 2021/1/9 15:07 */ - @GetResource(name = "获取资源树列表,用于分配接口权限", path = "/resource/getLateralTreeChildren") + @GetResource(name = "AntdVue版本--获取资源树列表,用于角色分配接口权限", path = "/resource/getRoleResourceTreeAntdv") public ResponseData getLateralTreeChildren(SysRoleRequest sysRoleRequest) { - List resourceLateralTree = sysResourceService.getResourceTree(sysRoleRequest.getRoleId(), false); + List resourceLateralTree = sysResourceService.getResourceTree(sysRoleRequest.getRoleId(), true); return new SuccessResponseData(resourceLateralTree); } diff --git a/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/SysResourceService.java b/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/SysResourceService.java index 8998b52ff..faebfe20a 100644 --- a/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/SysResourceService.java +++ b/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/SysResourceService.java @@ -41,14 +41,14 @@ public interface SysResourceService extends IService { List findList(ResourceRequest resourceRequest); /** - * 获取平级树节点列表 + * 获取资源平级树列表,用于分配接口权限 * - * @param roleId 角色id - * @param lateralFlag true-不带树形结构,false-返回带树形结构的 + * @param roleId 角色id + * @param treeBuildFlag true-带树形结构,false-不组装树形结构的 * @author majianguo * @date 2021/1/9 15:08 */ - List getResourceTree(Long roleId, Boolean lateralFlag); + List getResourceTree(Long roleId, Boolean treeBuildFlag); /** * 获取资源树列表,用于生成api接口 diff --git a/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/impl/SysResourceServiceImpl.java b/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/impl/SysResourceServiceImpl.java index 4815505f3..a4cdb077c 100644 --- a/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/impl/SysResourceServiceImpl.java +++ b/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/impl/SysResourceServiceImpl.java @@ -85,7 +85,7 @@ public class SysResourceServiceImpl extends ServiceImpl getResourceTree(Long roleId, Boolean lateralFlag) { + public List getResourceTree(Long roleId, Boolean treeBuildFlag) { List res = new ArrayList<>(); @@ -162,10 +162,10 @@ public class SysResourceServiceImpl extends ServiceImpl().doTreeBuild(res); + } else { + return res; } }