Skip to content

Commit

Permalink
feat-RuntimeController-menu接口支持用rootID控制根节点
Browse files Browse the repository at this point in the history
  • Loading branch information
aruis committed Dec 12, 2024
1 parent 6b14a1a commit 6918f7f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ public IRuntimeUser whoami() {
@GET
@Path("/menu")
@Operation(summary = "查询当前用户菜单信息")
public List<TreeNode> menu(@QueryParam("terminalType") String terminalType) {
public List<TreeNode> menu(@QueryParam("terminalType") String terminalType, @QueryParam("rootID") String rootID, @QueryParam("showMe") Boolean showMe) {
String userID = getUser().getId();

showMe = showMe != null && showMe;

if (IRuntimeUser.WHITE.getId().equals(userID)) {
throw new PermsException("未登录用户没有查询菜单的权限");
} else if (config.isSuperUser(userID)) {
Expand All @@ -86,7 +88,7 @@ public List<TreeNode> menu(@QueryParam("terminalType") String terminalType) {
order by app_menu.n_order
""", schemaID);

List<TreeNode> treeNodes = TreeBuilder.build("id", "pid", list, null, false, "v_name", null);
List<TreeNode> treeNodes = TreeBuilder.build("id", "pid", list, rootID, showMe, "v_name", null);
return filterMenuByAuth(treeNodes);
}
}
Expand Down

0 comments on commit 6918f7f

Please sign in to comment.