mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-09 21:59:22 +00:00
update 优化 修改角色如果未绑定用户则无需清理
This commit is contained in:
@@ -434,6 +434,11 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||
|
||||
@Override
|
||||
public void cleanOnlineUserByRole(Long roleId) {
|
||||
// 如果角色未绑定用户 直接返回
|
||||
Long num = userRoleMapper.selectCount(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getRoleId, roleId));
|
||||
if (num == 0) {
|
||||
return;
|
||||
}
|
||||
List<String> keys = StpUtil.searchTokenValue("", 0, -1, false);
|
||||
if (CollUtil.isEmpty(keys)) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user