用户管理给用户授权角色,删除USER_ROLE_ID_LIST下所有缓存,解决不同机构人授权没有马上生效问题

This commit is contained in:
gaoqr
2024-06-20 18:45:07 +08:00
parent 24bc0e60e9
commit 6e686816b4
@@ -375,7 +375,7 @@ public class PermissionServiceImpl implements PermissionService {
@Override
@DSTransactional // 多数据源,使用 @DSTransactional 保证本地事务,以及数据源的切换
@CacheEvict(value = RedisKeyConstants.USER_ROLE_ID_LIST, key = "#userId")
@CacheEvict(value = RedisKeyConstants.USER_ROLE_ID_LIST, allEntries = true)
public void assignUserRole(Long userId, Set<Long> roleIds, Long organId) {
if(Objects.equals(userId, SecurityFrameworkUtils.getLoginUserId())) {
throw exception(ROLE_ME_ERROR);