| | |
| | | import me.zhyd.oauth.model.AuthUser; |
| | | import me.zhyd.oauth.request.AuthRequest; |
| | | import me.zhyd.oauth.utils.AuthStateUtils; |
| | | import org.dromara.common.core.constant.UserConstants; |
| | | import org.dromara.common.core.constant.SystemConstants; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.core.domain.model.LoginBody; |
| | | import org.dromara.common.core.domain.model.RegisterBody; |
| | |
| | | import org.dromara.common.social.config.properties.SocialLoginConfigProperties; |
| | | import org.dromara.common.social.config.properties.SocialProperties; |
| | | import org.dromara.common.social.utils.SocialUtils; |
| | | import org.dromara.common.sse.dto.SseMessageDto; |
| | | import org.dromara.common.sse.utils.SseMessageUtils; |
| | | 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.bo.SysTenantBo; |
| | | import org.dromara.system.domain.vo.SysClientVo; |
| | | import org.dromara.system.domain.vo.SysTenantVo; |
| | |
| | | if (ObjectUtil.isNull(client) || !StringUtils.contains(client.getGrantType(), grantType)) { |
| | | log.info("客户端id: {} 认证类型:{} 异常!.", clientId, grantType); |
| | | return R.fail(MessageUtils.message("auth.grant.type.error")); |
| | | } else if (!UserConstants.NORMAL.equals(client.getStatus())) { |
| | | } else if (!SystemConstants.NORMAL.equals(client.getStatus())) { |
| | | return R.fail(MessageUtils.message("auth.grant.type.blocked")); |
| | | } |
| | | // 校验租户 |
| | |
| | | |
| | | Long userId = LoginHelper.getUserId(); |
| | | scheduledExecutorService.schedule(() -> { |
| | | WebSocketMessageDto dto = new WebSocketMessageDto(); |
| | | SseMessageDto dto = new SseMessageDto(); |
| | | dto.setMessage("欢迎登录RuoYi-Vue-Plus后台管理系统"); |
| | | dto.setSessionKeys(List.of(userId)); |
| | | WebSocketUtils.publishMessage(dto); |
| | | }, 3, TimeUnit.SECONDS); |
| | | dto.setUserIds(List.of(userId)); |
| | | SseMessageUtils.publishMessage(dto); |
| | | }, 5, TimeUnit.SECONDS); |
| | | return R.ok(loginVo); |
| | | } |
| | | |
| | |
| | | } |
| | | // 根据域名进行筛选 |
| | | List<TenantListVo> list = StreamUtils.filter(voList, vo -> |
| | | StringUtils.equals(vo.getDomain(), host)); |
| | | StringUtils.equalsIgnoreCase(vo.getDomain(), host)); |
| | | result.setVoList(CollUtil.isNotEmpty(list) ? list : voList); |
| | | return R.ok(result); |
| | | } |