diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/base/AuthController.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/base/AuthController.java index a38591a..ffc4ad4 100644 --- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/base/AuthController.java +++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/base/AuthController.java @@ -155,15 +155,18 @@ public class AuthController extends CoreBaseController { */ @GetMapping(value = "/menu/find-module-list/{parentId}") @ApiOperation(value = "获取登录用户功能权限信息", notes = "获取首页权限信息") - public ResultBean findMenuModuleList(@PathVariable("parentId") String parentId) { + public ResultBean findMenuModuleList(@PathVariable("parentId") String parentId, Integer menuSort) { try { ValidatorBean.checkIsNumber(parentId, "父节点不能为空"); List result = memTreeService.packTreeSysMenuByUserIdAndParentId(getSessionUser().getUser().getId(), Long.parseLong(parentId)); - for (SysMenu sysMenu : result) { - sysMenu.setChildList(sysMenu.getChildList().stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList())); + //如果menuSort为0,则不用通过menuSort字段进行排序 + if (menuSort != 0) { + for (SysMenu sysMenu : result) { + sysMenu.setChildList(sysMenu.getChildList().stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList())); + } + result = result.stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList()); } - result = result.stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList()); result = sysMenuService.setLanguageSysMenuName(AuthUtil.getSessionUser().getLanguageCode(), result); return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(result); } catch (ImppBusiException busExcep) {