From 3415f0836f478744cb9536ec542bba2b4a6acd62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=96=87=E8=B1=AA?= <980287353@qq.com> Date: Tue, 13 Aug 2024 14:42:11 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8Dplatform=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=96=B9=E5=BC=8F=E5=BC=82=E5=B8=B8=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/tiesheng/annotation/role/RoleAuthority.java | 2 +- .../com/tiesheng/role/service/RoleAuthorityHandler.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/springboot-annotation/src/main/java/com/tiesheng/annotation/role/RoleAuthority.java b/springboot-annotation/src/main/java/com/tiesheng/annotation/role/RoleAuthority.java index 55a81e5..e5968f8 100644 --- a/springboot-annotation/src/main/java/com/tiesheng/annotation/role/RoleAuthority.java +++ b/springboot-annotation/src/main/java/com/tiesheng/annotation/role/RoleAuthority.java @@ -20,7 +20,7 @@ public @interface RoleAuthority { * * @return */ - String platform() default "web"; + String platform() default ""; /** diff --git a/springboot-role/src/main/java/com/tiesheng/role/service/RoleAuthorityHandler.java b/springboot-role/src/main/java/com/tiesheng/role/service/RoleAuthorityHandler.java index 4edb194..b4c8d18 100644 --- a/springboot-role/src/main/java/com/tiesheng/role/service/RoleAuthorityHandler.java +++ b/springboot-role/src/main/java/com/tiesheng/role/service/RoleAuthorityHandler.java @@ -32,6 +32,8 @@ public class RoleAuthorityHandler implements TsAuthorityHandler { return; } + String menuPlatform = StrUtil.emptyToDefault(menu.platform(), "web"); + List list = new ArrayList<>(); // 分组 @@ -52,7 +54,7 @@ public class RoleAuthorityHandler implements TsAuthorityHandler { groupAuthority.setService(globalConfig.getService()); groupAuthority.setType("group"); groupAuthority.setLevel(level); - groupAuthority.setPlatform(menu.platform()); + groupAuthority.setPlatform(menuPlatform); groupAuthority.setParent(parentId); groupAuthority.setVersion(version); groupAuthority.setId(StrUtil.join("_", groupAuthority.getService(), groupAuthority.getNo())); @@ -68,7 +70,7 @@ public class RoleAuthorityHandler implements TsAuthorityHandler { menuAuthority.setType("menu"); menuAuthority.setLevel(groupAuthority.getLevel() + 1); menuAuthority.setParent(groupAuthority.getId()); - menuAuthority.setPlatform(menu.platform()); + menuAuthority.setPlatform(menuPlatform); menuAuthority.setVersion(version); menuAuthority.setId(StrUtil.join("_", menuAuthority.getService(), menuAuthority.getNo())); list.add(menuAuthority); @@ -83,7 +85,7 @@ public class RoleAuthorityHandler implements TsAuthorityHandler { point.setLevel(menuAuthority.getLevel() + 1); point.setParent(menuAuthority.getId()); point.setVersion(version); - point.setPlatform(StrUtil.emptyToDefault(authority.platform(), menu.platform())); + point.setPlatform(StrUtil.emptyToDefault(authority.platform(), menuPlatform)); point.setId(StrUtil.join("_", point.getService(), point.getNo())); list.add(point); }