| | |
| | | import org.dromara.common.social.config.properties.SocialProperties; |
| | | import org.dromara.common.social.utils.SocialUtils; |
| | | import org.dromara.common.tenant.helper.TenantHelper; |
| | | import org.dromara.common.websocket.dto.WebSocketMessageDto; |
| | | 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.vo.SysClientVo; |
| | | import org.dromara.system.domain.vo.SysTenantVo; |
| | | import org.dromara.system.service.ISysClientService; |
| | | import org.dromara.system.service.ISysConfigService; |
| | |
| | | // 授权类型和客户端id |
| | | String clientId = loginBody.getClientId(); |
| | | String grantType = loginBody.getGrantType(); |
| | | SysClient client = clientService.queryByClientId(clientId); |
| | | SysClientVo client = clientService.queryByClientId(clientId); |
| | | // 查询不到 client 或 client 内不包含 grantType |
| | | if (ObjectUtil.isNull(client) || !StringUtils.contains(client.getGrantType(), grantType)) { |
| | | log.info("客户端id: {} 认证类型:{} 异常!.", clientId, grantType); |
| | |
| | | |
| | | Long userId = LoginHelper.getUserId(); |
| | | 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); |
| | | return R.ok(loginVo); |
| | | } |