From d883e11fac8ff90fb4ff8b97122f2c5eb2a516e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= Date: Tue, 3 Mar 2020 17:17:22 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20Fixing=20a=20bug.=20#820=20=E3=80=90?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86=E3=80=91=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=8C=89=E9=92=AE=20>=20=E6=9D=83=E9=99=90=20=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pigx/admin/api/dto/MenuTree.java | 21 +++++-------------- .../pig4cloud/pigx/admin/api/vo/TreeUtil.java | 2 +- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/dto/MenuTree.java b/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/dto/MenuTree.java index b496a5887..1bb3d0e23 100644 --- a/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/dto/MenuTree.java +++ b/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/dto/MenuTree.java @@ -41,7 +41,7 @@ public class MenuTree extends TreeNode implements Serializable { @ApiModelProperty(value = "菜单图标") private String icon; /** - * 菜单名称 + * 菜单名称 */ @ApiModelProperty(value = "菜单名称") private String name; @@ -60,7 +60,7 @@ public class MenuTree extends TreeNode implements Serializable { * 权限编码 */ @ApiModelProperty(value = "权限编码") - private String code; + private String permission; /** * 菜单类型 (0菜单 1按钮) */ @@ -79,26 +79,14 @@ public class MenuTree extends TreeNode implements Serializable { /** * 是否包含子节点 + * * @since 3.7 */ private Boolean hasChildren; + public MenuTree() { } - public MenuTree(int id, String name, int parentId) { - this.id = id; - this.parentId = parentId; - this.name = name; - this.label = name; - } - - public MenuTree(int id, String name, MenuTree parent) { - this.id = id; - this.parentId = parent.getId(); - this.name = name; - this.label = name; - } - public MenuTree(MenuVO menuVo) { this.id = menuVo.getMenuId(); this.parentId = menuVo.getParentId(); @@ -108,6 +96,7 @@ public class MenuTree extends TreeNode implements Serializable { this.type = menuVo.getType(); this.label = menuVo.getName(); this.sort = menuVo.getSort(); + this.permission = menuVo.getPermission(); this.keepAlive = menuVo.getKeepAlive(); } } diff --git a/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/vo/TreeUtil.java b/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/vo/TreeUtil.java index 60e46bb27..28e65cd0b 100644 --- a/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/vo/TreeUtil.java +++ b/pigx-upms/pigx-upms-api/src/main/java/com/pig4cloud/pigx/admin/api/vo/TreeUtil.java @@ -112,13 +112,13 @@ public class TreeUtil { node.setParentId(menu.getParentId()); node.setName(menu.getName()); node.setPath(menu.getPath()); - node.setCode(menu.getPermission()); node.setLabel(menu.getName()); node.setIcon(menu.getIcon()); node.setType(menu.getType()); node.setSort(menu.getSort()); node.setHasChildren(true); node.setKeepAlive(menu.getKeepAlive()); + node.setPermission(menu.getPermission()); trees.add(node); } return TreeUtil.build(trees, root);