diff --git a/.mvn/repository/org/apache/maven/plugins/maven-clean-plugin/3.3.2/m2e-lastUpdated.properties b/.mvn/repository/org/apache/maven/plugins/maven-clean-plugin/3.3.2/m2e-lastUpdated.properties index ec18657..d0b2e0c 100644 --- a/.mvn/repository/org/apache/maven/plugins/maven-clean-plugin/3.3.2/m2e-lastUpdated.properties +++ b/.mvn/repository/org/apache/maven/plugins/maven-clean-plugin/3.3.2/m2e-lastUpdated.properties @@ -1,2 +1,2 @@ -#Thu Feb 19 19:13:53 CST 2026 -central|https\://repo1.maven.org/maven2|null=1771499633540 +#Fri Feb 20 11:21:39 CST 2026 +central|https\://repo1.maven.org/maven2|null=1771557699084 diff --git a/.mvn/repository/org/apache/maven/plugins/maven-compiler-plugin/3.11.0/m2e-lastUpdated.properties b/.mvn/repository/org/apache/maven/plugins/maven-compiler-plugin/3.11.0/m2e-lastUpdated.properties index 3a1fa84..663cac8 100644 --- a/.mvn/repository/org/apache/maven/plugins/maven-compiler-plugin/3.11.0/m2e-lastUpdated.properties +++ b/.mvn/repository/org/apache/maven/plugins/maven-compiler-plugin/3.11.0/m2e-lastUpdated.properties @@ -1,2 +1,2 @@ -#Thu Feb 19 19:13:53 CST 2026 -central|https\://repo1.maven.org/maven2|null=1771499633542 +#Fri Feb 20 11:21:39 CST 2026 +central|https\://repo1.maven.org/maven2|null=1771557699091 diff --git a/.mvn/repository/org/apache/maven/plugins/maven-deploy-plugin/3.1.1/m2e-lastUpdated.properties b/.mvn/repository/org/apache/maven/plugins/maven-deploy-plugin/3.1.1/m2e-lastUpdated.properties index cbe9c94..e25c08b 100644 --- a/.mvn/repository/org/apache/maven/plugins/maven-deploy-plugin/3.1.1/m2e-lastUpdated.properties +++ b/.mvn/repository/org/apache/maven/plugins/maven-deploy-plugin/3.1.1/m2e-lastUpdated.properties @@ -1,2 +1,2 @@ -#Thu Feb 19 19:13:53 CST 2026 -central|https\://repo1.maven.org/maven2|null=1771499633545 +#Fri Feb 20 11:21:39 CST 2026 +central|https\://repo1.maven.org/maven2|null=1771557699097 diff --git a/.mvn/repository/org/apache/maven/plugins/maven-install-plugin/3.1.1/m2e-lastUpdated.properties b/.mvn/repository/org/apache/maven/plugins/maven-install-plugin/3.1.1/m2e-lastUpdated.properties index 83c9870..461661b 100644 --- a/.mvn/repository/org/apache/maven/plugins/maven-install-plugin/3.1.1/m2e-lastUpdated.properties +++ b/.mvn/repository/org/apache/maven/plugins/maven-install-plugin/3.1.1/m2e-lastUpdated.properties @@ -1,2 +1,2 @@ -#Thu Feb 19 19:13:53 CST 2026 -central|https\://repo1.maven.org/maven2|null=1771499633544 +#Fri Feb 20 11:21:39 CST 2026 +central|https\://repo1.maven.org/maven2|null=1771557699096 diff --git a/.mvn/repository/org/apache/maven/plugins/maven-jar-plugin/3.3.0/m2e-lastUpdated.properties b/.mvn/repository/org/apache/maven/plugins/maven-jar-plugin/3.3.0/m2e-lastUpdated.properties index c50fe69..6800127 100644 --- a/.mvn/repository/org/apache/maven/plugins/maven-jar-plugin/3.3.0/m2e-lastUpdated.properties +++ b/.mvn/repository/org/apache/maven/plugins/maven-jar-plugin/3.3.0/m2e-lastUpdated.properties @@ -1,2 +1,2 @@ -#Thu Feb 19 19:13:53 CST 2026 -central|https\://repo1.maven.org/maven2|null=1771499633543 +#Fri Feb 20 11:21:39 CST 2026 +central|https\://repo1.maven.org/maven2|null=1771557699093 diff --git a/.mvn/repository/org/apache/maven/plugins/maven-resources-plugin/3.3.1/m2e-lastUpdated.properties b/.mvn/repository/org/apache/maven/plugins/maven-resources-plugin/3.3.1/m2e-lastUpdated.properties index 3a1fa84..f42d137 100644 --- a/.mvn/repository/org/apache/maven/plugins/maven-resources-plugin/3.3.1/m2e-lastUpdated.properties +++ b/.mvn/repository/org/apache/maven/plugins/maven-resources-plugin/3.3.1/m2e-lastUpdated.properties @@ -1,2 +1,2 @@ -#Thu Feb 19 19:13:53 CST 2026 -central|https\://repo1.maven.org/maven2|null=1771499633542 +#Fri Feb 20 11:21:39 CST 2026 +central|https\://repo1.maven.org/maven2|null=1771557699090 diff --git a/.mvn/repository/org/apache/maven/plugins/maven-site-plugin/3.12.1/m2e-lastUpdated.properties b/.mvn/repository/org/apache/maven/plugins/maven-site-plugin/3.12.1/m2e-lastUpdated.properties index cbe9c94..66d35d6 100644 --- a/.mvn/repository/org/apache/maven/plugins/maven-site-plugin/3.12.1/m2e-lastUpdated.properties +++ b/.mvn/repository/org/apache/maven/plugins/maven-site-plugin/3.12.1/m2e-lastUpdated.properties @@ -1,2 +1,2 @@ -#Thu Feb 19 19:13:53 CST 2026 -central|https\://repo1.maven.org/maven2|null=1771499633545 +#Fri Feb 20 11:21:39 CST 2026 +central|https\://repo1.maven.org/maven2|null=1771557699098 diff --git a/.mvn/repository/org/apache/maven/plugins/maven-surefire-plugin/3.1.2/m2e-lastUpdated.properties b/.mvn/repository/org/apache/maven/plugins/maven-surefire-plugin/3.1.2/m2e-lastUpdated.properties index c50fe69..a004257 100644 --- a/.mvn/repository/org/apache/maven/plugins/maven-surefire-plugin/3.1.2/m2e-lastUpdated.properties +++ b/.mvn/repository/org/apache/maven/plugins/maven-surefire-plugin/3.1.2/m2e-lastUpdated.properties @@ -1,2 +1,2 @@ -#Thu Feb 19 19:13:53 CST 2026 -central|https\://repo1.maven.org/maven2|null=1771499633543 +#Fri Feb 20 11:21:39 CST 2026 +central|https\://repo1.maven.org/maven2|null=1771557699092 diff --git a/.mvn/repository/org/springframework/boot/spring-boot-maven-plugin/3.2.0/m2e-lastUpdated.properties b/.mvn/repository/org/springframework/boot/spring-boot-maven-plugin/3.2.0/m2e-lastUpdated.properties index 83c9870..911888b 100644 --- a/.mvn/repository/org/springframework/boot/spring-boot-maven-plugin/3.2.0/m2e-lastUpdated.properties +++ b/.mvn/repository/org/springframework/boot/spring-boot-maven-plugin/3.2.0/m2e-lastUpdated.properties @@ -1,2 +1,2 @@ -#Thu Feb 19 19:13:53 CST 2026 -central|https\://repo1.maven.org/maven2|null=1771499633544 +#Fri Feb 20 11:21:39 CST 2026 +central|https\://repo1.maven.org/maven2|null=1771557699094 diff --git a/fund-gateway/src/main/java/com/fundplatform/gateway/filter/TenantGatewayFilter.java b/fund-gateway/src/main/java/com/fundplatform/gateway/filter/TenantGatewayFilter.java index 7cb3c85..910d95b 100644 --- a/fund-gateway/src/main/java/com/fundplatform/gateway/filter/TenantGatewayFilter.java +++ b/fund-gateway/src/main/java/com/fundplatform/gateway/filter/TenantGatewayFilter.java @@ -16,8 +16,8 @@ import java.util.List; /** * 租户信息全局过滤器 * - *
从请求头中获取用户信息(由TokenAuthFilter解析),构建租户组信息
- *在TokenAuthFilter之后执行,用于多租户路由
+ *从请求头中获取用户信息(由TokenAuthFilter解析)
+ *在TokenAuthFilter之后执行,用于日志记录
*/ @Component public class TenantGatewayFilter implements GlobalFilter, Ordered { @@ -26,7 +26,6 @@ public class TenantGatewayFilter implements GlobalFilter, Ordered { // Header 名称(由TokenAuthFilter设置) public static final String HEADER_TENANT_ID = "X-Tenant-Id"; - public static final String HEADER_TENANT_GROUP = "X-Tenant-Group"; public static final String HEADER_USER_ID = "X-User-Id"; public static final String HEADER_USERNAME = "X-Username"; @@ -51,18 +50,10 @@ public class TenantGatewayFilter implements GlobalFilter, Ordered { String userId = request.getHeaders().getFirst(HEADER_USER_ID); String username = request.getHeaders().getFirst(HEADER_USERNAME); - // 构建租户组信息 - String tenantGroup = buildTenantGroup(tenantId); + logger.debug("[TenantGateway] 租户ID: {}, 用户ID: {}, 用户名: {}, 路径: {}", + tenantId, userId, username, path); - // 将租户组信息写入请求头 - ServerHttpRequest mutatedRequest = request.mutate() - .header(HEADER_TENANT_GROUP, tenantGroup) - .build(); - - logger.debug("[TenantGateway] 租户ID: {}, 租户组: {}, 用户: {}, 路径: {}", - tenantId, tenantGroup, username, path); - - return chain.filter(exchange.mutate().request(mutatedRequest).build()); + return chain.filter(exchange); } /** @@ -72,16 +63,6 @@ public class TenantGatewayFilter implements GlobalFilter, Ordered { return WHITE_LIST.stream().anyMatch(path::startsWith); } - /** - * 构建租户组名称 - */ - private String buildTenantGroup(String tenantId) { - if (tenantId == null || tenantId.isEmpty()) { - return "DEFAULT"; - } - return "TENANT_" + tenantId.toUpperCase(); - } - @Override public int getOrder() { return Ordered.HIGHEST_PRECEDENCE + 2; // 在TokenAuthFilter之后执行 diff --git a/fund-sys/src/main/resources/application-docker.yml b/fund-sys/src/main/resources/application-docker.yml index ae882ae..7d57375 100644 --- a/fund-sys/src/main/resources/application-docker.yml +++ b/fund-sys/src/main/resources/application-docker.yml @@ -73,7 +73,6 @@ tenant: routing: enabled: true tenant-header: X-Tenant-Id - tenant-group-header: X-Tenant-Group default-tenant-id: "1" shared-services: - fund-gateway diff --git a/fund-sys/src/main/resources/application.yml b/fund-sys/src/main/resources/application.yml index f6b2feb..ba6e3bc 100644 --- a/fund-sys/src/main/resources/application.yml +++ b/fund-sys/src/main/resources/application.yml @@ -76,12 +76,11 @@ logging: pattern: console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n" -# 多租户路由配置(服务实例只需声明自己的租户组) +# 多租户路由配置 tenant: routing: enabled: true tenant-header: X-Tenant-Id - tenant-group-header: X-Tenant-Group default-tenant-id: "1" # 共享服务列表 shared-services: