Commit a8e895fca73e509adc667081cfa57b55d5fda35a
1 parent
01875185
暂时取消角色 缓存 防止数据库直接删除不生效,增加数据权限取消
Showing
1 changed file
with
3 additions
and
1 deletions
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/permission/RoleServiceImpl.java
| ... | ... | @@ -11,6 +11,7 @@ import com.zteits.urbanops.framework.common.enums.CommonStatusEnum; |
| 11 | 11 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 12 | 12 | import com.zteits.urbanops.framework.common.util.collection.CollectionUtils; |
| 13 | 13 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 14 | +import com.zteits.urbanops.framework.datapermission.core.annotation.DataPermission; | |
| 14 | 15 | import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RolePageReqVO; |
| 15 | 16 | import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RoleRespVO; |
| 16 | 17 | import com.zteits.urbanops.module.system.controller.admin.permission.vo.role.RoleSaveReqVO; |
| ... | ... | @@ -64,11 +65,12 @@ public class RoleServiceImpl implements RoleService { |
| 64 | 65 | * 从缓存中批量获取角色信息,缓存未命中则查询数据库并缓存结果 |
| 65 | 66 | */ |
| 66 | 67 | @Override |
| 67 | - @Cacheable(value = "role", key = "#roleIdList.toString()", unless = "#result.isEmpty()") | |
| 68 | + //@Cacheable(value = "role", key = "#roleIdList.toString()", unless = "#result.isEmpty()") | |
| 68 | 69 | // 缓存注解说明: |
| 69 | 70 | // value:缓存名称,区分不同模块缓存 |
| 70 | 71 | // key:缓存键,用角色ID列表拼接作为唯一键 |
| 71 | 72 | // unless:结果为空时不缓存,避免无效缓存 |
| 73 | + @DataPermission(enable = false) | |
| 72 | 74 | public Map<Long, RoleDO> getRoleMapFromCache(List<Long> roleIdList) { |
| 73 | 75 | // 1. 空值处理,避免无效查询 |
| 74 | 76 | if (CollUtil.isEmpty(roleIdList)) { | ... | ... |