update 优化校验角色是否有数据权限

This commit is contained in:
AprilWind 2025-07-04 18:39:54 +08:00
parent eb631360f4
commit f3c4c02d73

View File

@ -257,11 +257,9 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
if (LoginHelper.isSuperAdmin()) { if (LoginHelper.isSuperAdmin()) {
return; return;
} }
List<SysRoleVo> roles = this.selectRoleList(new SysRoleBo(roleId)); if (baseMapper.selectRoleCount(Collections.singletonList(roleId)) == 0) {
if (CollUtil.isEmpty(roles)) {
throw new ServiceException("没有权限访问角色数据!"); throw new ServiceException("没有权限访问角色数据!");
} }
} }
/** /**