diff --git a/kernel-s-system/system-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/role/service/impl/SysRoleServiceImpl.java b/kernel-s-system/system-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/role/service/impl/SysRoleServiceImpl.java index 81706502e..1d0ff38c6 100644 --- a/kernel-s-system/system-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/role/service/impl/SysRoleServiceImpl.java +++ b/kernel-s-system/system-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/role/service/impl/SysRoleServiceImpl.java @@ -218,10 +218,11 @@ public class SysRoleServiceImpl extends ServiceImpl impl // 按数据范围降序排列,50-全部数据最大 sysRoleLambdaQueryWrapper.orderByDesc(SysRole::getDataScopeType); - SysRole sysRole = this.getOne(sysRoleLambdaQueryWrapper, false); - if (sysRole != null) { - if (sysRole.getDataScopeType() != null) { - return DataScopeTypeEnum.codeToEnum(sysRole.getDataScopeType()); + List sysRoleList = this.list(sysRoleLambdaQueryWrapper); + if (ObjectUtil.isNotEmpty(sysRoleList)) { + Integer dataScopeType = sysRoleList.get(0).getDataScopeType(); + if (dataScopeType != null) { + return DataScopeTypeEnum.codeToEnum(dataScopeType); } }