feat(login): 新增网页AI登录场景WEB_AI

- 在LoginSceneEnum中增加WEB_AI枚举,绑定路径webAi-doLogin
- LoginService扩展WEB_AI登录逻辑:缓存登录态、创建w.tenant.{tenantId}队列并绑定webAiHeadersExchange
- 新增webAiHeadersExchange Bean,交换机名web.ai.headers.exchange
- 用户实体与Service增加web_ai字段及checkWebAILoginRole权限校验
- 提供/webAi-doLogin接口,支持网页端AI独立登录与Token管理
This commit is contained in:
2025-12-05 13:57:16 +08:00
parent cd7aba7aaa
commit e2eb5f9ad0
8 changed files with 72 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ public class RabbitMQConfig {
public static final String EXCHANGE_NAME = "user.headers.exchange";
public static final String AI_CHAT_EXCHANGE_NAME = "ai.chat.headers.exchange";
public static final String BIG_BROTHER_EXCHANGE_NAME = "big.brother.headers.exchange";
public static final String WEB_AI_EXCHANGE_NAME = "web.ai.headers.exchange";
//创建队列
//true:表示持久化
@@ -55,12 +56,20 @@ public class RabbitMQConfig {
.build();
}
@Bean
public HeadersExchange bigBrotherHeadersExchange() {
return ExchangeBuilder.headersExchange(BIG_BROTHER_EXCHANGE_NAME)
.durable(true)
.build();
}
/** 网页AI使用的 HeadersExchange */
@Bean
public HeadersExchange webAiHeadersExchange() {
return ExchangeBuilder.headersExchange(WEB_AI_EXCHANGE_NAME)
.durable(true)
.build();
}
@Bean
public RabbitAdmin rabbitAdmin(ConnectionFactory cf) {

View File

@@ -50,6 +50,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
"/user/bigbrother-doLogin",
"/user/aiChat-doLogin",
"/user/aiChat-logout",
"/user/webAi-doLogin",
"/error",
};
}