mirror of https://gitee.com/stylefeng/roses
【8.1.0】【user-org】修改用户角色绑定要清空缓存
parent
4b79abc297
commit
f3b50f63d4
|
@ -1,5 +1,6 @@
|
||||||
package cn.stylefeng.roses.kernel.sys.modular.user.service.impl;
|
package cn.stylefeng.roses.kernel.sys.modular.user.service.impl;
|
||||||
|
|
||||||
|
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
|
||||||
import cn.stylefeng.roses.kernel.rule.enums.StatusEnum;
|
import cn.stylefeng.roses.kernel.rule.enums.StatusEnum;
|
||||||
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||||
import cn.stylefeng.roses.kernel.sys.api.SysRoleServiceApi;
|
import cn.stylefeng.roses.kernel.sys.api.SysRoleServiceApi;
|
||||||
|
@ -42,6 +43,9 @@ public class SysRoleAssignServiceImpl implements SysRoleAssignService {
|
||||||
@Resource
|
@Resource
|
||||||
private SysUserRoleService sysUserRoleService;
|
private SysUserRoleService sysUserRoleService;
|
||||||
|
|
||||||
|
@Resource(name = "userRoleCache")
|
||||||
|
private CacheOperatorApi<List<SysUserRole>> userRoleCache;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<NewUserRoleBindResponse> getUserAssignList(Long userId) {
|
public List<NewUserRoleBindResponse> getUserAssignList(Long userId) {
|
||||||
|
|
||||||
|
@ -108,6 +112,9 @@ public class SysRoleAssignServiceImpl implements SysRoleAssignService {
|
||||||
else if (pointUserRole != null) {
|
else if (pointUserRole != null) {
|
||||||
sysUserRoleService.removeById(pointUserRole.getUserRoleId());
|
sysUserRoleService.removeById(pointUserRole.getUserRoleId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清空用户绑定的缓存
|
||||||
|
userRoleCache.remove(String.valueOf(roleControlRequest.getUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -119,6 +126,9 @@ public class SysRoleAssignServiceImpl implements SysRoleAssignService {
|
||||||
|
|
||||||
// 2. 删除用户在机构下的所有角色信息
|
// 2. 删除用户在机构下的所有角色信息
|
||||||
this.sysUserRoleService.removeUserOrgRoleLink(deleteRequest.getUserId(), deleteRequest.getOrgId());
|
this.sysUserRoleService.removeUserOrgRoleLink(deleteRequest.getUserId(), deleteRequest.getOrgId());
|
||||||
|
|
||||||
|
// 3. 清空缓存
|
||||||
|
userRoleCache.remove(String.valueOf(deleteRequest.getUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue