|
@@ -131,7 +131,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|
commonCacheService.updateRoleCache(role.getId());
|
|
commonCacheService.updateRoleCache(role.getId());
|
|
boolean isChange = sysRolePrivilegeService.saveBatch(role);//角色权限
|
|
boolean isChange = sysRolePrivilegeService.saveBatch(role);//角色权限
|
|
if (isChange) {
|
|
if (isChange) {
|
|
- commonCacheService.updateRolePrivilegeCache(role.getId());
|
|
|
|
|
|
+// commonCacheService.removeRolePrivilegeCache(schoolId, role.getId());
|
|
//绑定该角色的用户都需要清除鉴权缓存
|
|
//绑定该角色的用户都需要清除鉴权缓存
|
|
List<SysUserRole> sysUserRoleList = sysUserRoleService.listByRoleId(role.getId());
|
|
List<SysUserRole> sysUserRoleList = sysUserRoleService.listByRoleId(role.getId());
|
|
commonService.removeUserInfoBatch(sysUserRoleList.stream().map(SysUserRole::getUserId).collect(Collectors.toList()), true);
|
|
commonService.removeUserInfoBatch(sysUserRoleList.stream().map(SysUserRole::getUserId).collect(Collectors.toList()), true);
|
|
@@ -192,7 +192,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|
throw ExceptionResultEnum.ERROR.exception("自定义角色名称不能和系统默认角色[" + roleName + "]同名");
|
|
throw ExceptionResultEnum.ERROR.exception("自定义角色名称不能和系统默认角色[" + roleName + "]同名");
|
|
}
|
|
}
|
|
if (Objects.nonNull(role.getId())) {//编辑
|
|
if (Objects.nonNull(role.getId())) {//编辑
|
|
- List<SysRolePrivilege> sysRolePrivilegeList = commonCacheService.rolePrivilegeCache(role.getId());
|
|
|
|
|
|
+ List<SysRolePrivilege> sysRolePrivilegeList = commonCacheService.rolePrivilegeCache(sysUser.getSchoolId(), role.getId());
|
|
QueryWrapper<SysPrivilege> sysPrivilegeQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<SysPrivilege> sysPrivilegeQueryWrapper = new QueryWrapper<>();
|
|
sysPrivilegeQueryWrapper.lambda().in(SysPrivilege::getId, role.getPrivilegeIds());
|
|
sysPrivilegeQueryWrapper.lambda().in(SysPrivilege::getId, role.getPrivilegeIds());
|
|
List<SysPrivilege> sysPrivilegeList = sysPrivilegeService.list(sysPrivilegeQueryWrapper);
|
|
List<SysPrivilege> sysPrivilegeList = sysPrivilegeService.list(sysPrivilegeQueryWrapper);
|
|
@@ -218,7 +218,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|
// 删除权限前先更新涉及特殊权限用户 -> 需要重新同步
|
|
// 删除权限前先更新涉及特殊权限用户 -> 需要重新同步
|
|
sysRolePrivilegeService.removeByRoleId(role.getId());
|
|
sysRolePrivilegeService.removeByRoleId(role.getId());
|
|
sysRolePrivilegeService.saveBatch(role);//角色权限
|
|
sysRolePrivilegeService.saveBatch(role);//角色权限
|
|
- commonCacheService.updateRolePrivilegeCache(role.getId());
|
|
|
|
|
|
+// commonCacheService.updateRolePrivilegeCache(schoolId, role.getId());
|
|
//绑定该角色的用户都需要清除鉴权缓存
|
|
//绑定该角色的用户都需要清除鉴权缓存
|
|
List<SysUserRole> sysUserRoleList = sysUserRoleService.listByRoleId(role.getId());
|
|
List<SysUserRole> sysUserRoleList = sysUserRoleService.listByRoleId(role.getId());
|
|
commonService.removeUserInfoBatch(sysUserRoleList.stream().map(s -> s.getUserId()).collect(Collectors.toList()), true);
|
|
commonService.removeUserInfoBatch(sysUserRoleList.stream().map(s -> s.getUserId()).collect(Collectors.toList()), true);
|
|
@@ -298,7 +298,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|
sysRoleGroupMemberService.remove(sysRoleGroupMemberQueryWrapper);
|
|
sysRoleGroupMemberService.remove(sysRoleGroupMemberQueryWrapper);
|
|
|
|
|
|
commonCacheService.removeRoleCache(id);
|
|
commonCacheService.removeRoleCache(id);
|
|
- commonCacheService.removeRolePrivilegeCache(id);
|
|
|
|
|
|
+// commonCacheService.removeRolePrivilegeCache(sysRole.getSchoolId(), id);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -314,7 +314,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|
this.removeById(id);
|
|
this.removeById(id);
|
|
|
|
|
|
commonCacheService.removeRoleCache(id);
|
|
commonCacheService.removeRoleCache(id);
|
|
- commonCacheService.removeRolePrivilegeCache(id);
|
|
|
|
|
|
+// commonCacheService.removeRolePrivilegeCache(sysRole.getSchoolId(), id);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|