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); }