From f3b50f63d4a0692ca5b0a1fdf6d4b190a18dec5a Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Thu, 18 Jan 2024 15:01:12 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.1.0=E3=80=91=E3=80=90user-org?= =?UTF-8?q?=E3=80=91=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E8=A6=81=E6=B8=85=E7=A9=BA=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/service/impl/SysRoleAssignServiceImpl.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/impl/SysRoleAssignServiceImpl.java b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/impl/SysRoleAssignServiceImpl.java index 0f5568a2a..a670de259 100644 --- a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/impl/SysRoleAssignServiceImpl.java +++ b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/impl/SysRoleAssignServiceImpl.java @@ -1,5 +1,6 @@ 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.exception.base.ServiceException; import cn.stylefeng.roses.kernel.sys.api.SysRoleServiceApi; @@ -42,6 +43,9 @@ public class SysRoleAssignServiceImpl implements SysRoleAssignService { @Resource private SysUserRoleService sysUserRoleService; + @Resource(name = "userRoleCache") + private CacheOperatorApi> userRoleCache; + @Override public List getUserAssignList(Long userId) { @@ -108,6 +112,9 @@ public class SysRoleAssignServiceImpl implements SysRoleAssignService { else if (pointUserRole != null) { sysUserRoleService.removeById(pointUserRole.getUserRoleId()); } + + // 清空用户绑定的缓存 + userRoleCache.remove(String.valueOf(roleControlRequest.getUserId())); } @Override @@ -119,6 +126,9 @@ public class SysRoleAssignServiceImpl implements SysRoleAssignService { // 2. 删除用户在机构下的所有角色信息 this.sysUserRoleService.removeUserOrgRoleLink(deleteRequest.getUserId(), deleteRequest.getOrgId()); + + // 3. 清空缓存 + userRoleCache.remove(String.valueOf(deleteRequest.getUserId())); } } \ No newline at end of file