소스 검색

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

AprilWind 1 년 전
부모
커밋
f3c4c02d73
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java

+ 1 - 3
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java

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