mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-11-11 11:43:45 +08:00
update 优化 登录消息 支持集群发送
This commit is contained in:
@@ -23,8 +23,8 @@ import org.dromara.common.social.config.properties.SocialLoginConfigProperties;
|
|||||||
import org.dromara.common.social.config.properties.SocialProperties;
|
import org.dromara.common.social.config.properties.SocialProperties;
|
||||||
import org.dromara.common.social.utils.SocialUtils;
|
import org.dromara.common.social.utils.SocialUtils;
|
||||||
import org.dromara.common.tenant.helper.TenantHelper;
|
import org.dromara.common.tenant.helper.TenantHelper;
|
||||||
|
import org.dromara.common.websocket.dto.WebSocketMessageDto;
|
||||||
import org.dromara.common.websocket.utils.WebSocketUtils;
|
import org.dromara.common.websocket.utils.WebSocketUtils;
|
||||||
import org.dromara.system.domain.SysClient;
|
|
||||||
import org.dromara.system.domain.bo.SysTenantBo;
|
import org.dromara.system.domain.bo.SysTenantBo;
|
||||||
import org.dromara.system.domain.vo.SysClientVo;
|
import org.dromara.system.domain.vo.SysClientVo;
|
||||||
import org.dromara.system.domain.vo.SysTenantVo;
|
import org.dromara.system.domain.vo.SysTenantVo;
|
||||||
@@ -97,7 +97,10 @@ public class AuthController {
|
|||||||
|
|
||||||
Long userId = LoginHelper.getUserId();
|
Long userId = LoginHelper.getUserId();
|
||||||
scheduledExecutorService.schedule(() -> {
|
scheduledExecutorService.schedule(() -> {
|
||||||
WebSocketUtils.sendMessage(userId, "欢迎登录RuoYi-Vue-Plus后台管理系统");
|
WebSocketMessageDto dto = new WebSocketMessageDto();
|
||||||
|
dto.setMessage("欢迎登录RuoYi-Vue-Plus后台管理系统");
|
||||||
|
dto.setSessionKeys(List.of(userId));
|
||||||
|
WebSocketUtils.publishMessage(dto);
|
||||||
}, 3, TimeUnit.SECONDS);
|
}, 3, TimeUnit.SECONDS);
|
||||||
return R.ok(loginVo);
|
return R.ok(loginVo);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user