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 c61181c..00ac7f3 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 @@ -39,18 +39,19 @@ public class TenantGatewayFilter implements GlobalFilter, Ordered { // 白名单路径(不需要X-Tenant-Id) // 注意:路径是网关接收的原始请求路径(含/fund前缀) + // 健康检查路径需要包含模块名两次(一次用于路由,一次用于服务路径) private static final List TENANT_ID_WHITE_LIST = Arrays.asList( - "/fund/sys/auth/login", // 登录接口 - "/fund/sys/auth/logout", // 登出接口 - "/actuator/health", // 网关健康检查(无/fund前缀) - "/fund/sys/health", // 系统服务健康检查 - "/fund/cust/health", // 客户服务健康检查 - "/fund/proj/health", // 项目服务健康检查 - "/fund/exp/health", // 支出服务健康检查 - "/fund/receipt/health", // 收款服务健康检查 - "/fund/report/health", // 报表服务健康检查 - "/fund/req/health", // 请求服务健康检查 - "/fund/file/health" // 文件服务健康检查 + "/fund/sys/auth/login", // 登录接口 + "/fund/sys/auth/logout", // 登出接口 + "/actuator/health", // 网关健康检查(无/fund前缀) + "/fund/sys/sys/health", // 系统服务健康检查 (/api/v1/sys/health) + "/fund/cust/cust/health", // 客户服务健康检查 (/api/v1/cust/health) + "/fund/proj/proj/health", // 项目服务健康检查 (/api/v1/proj/health) + "/fund/exp/exp/health", // 支出服务健康检查 (/api/v1/exp/health) + "/fund/receipt/receipt/health", // 收款服务健康检查 (/api/v1/receipt/health) + "/fund/report/report/health", // 报表服务健康检查 (/api/v1/report/health) + "/fund/req/req/health", // 请求服务健康检查 (/api/v1/req/health) + "/fund/file/file/health" // 文件服务健康检查 (/api/v1/file/health) ); private final ObjectMapper objectMapper = new ObjectMapper(); diff --git a/fund-gateway/src/main/java/com/fundplatform/gateway/filter/TokenAuthFilter.java b/fund-gateway/src/main/java/com/fundplatform/gateway/filter/TokenAuthFilter.java index 79a192f..541e208 100644 --- a/fund-gateway/src/main/java/com/fundplatform/gateway/filter/TokenAuthFilter.java +++ b/fund-gateway/src/main/java/com/fundplatform/gateway/filter/TokenAuthFilter.java @@ -40,16 +40,17 @@ public class TokenAuthFilter implements GlobalFilter, Ordered { // 白名单路径(不需要token验证) // 注意:路径是网关接收的原始请求路径(含/fund前缀) + // 健康检查路径需要包含模块名两次(一次用于路由,一次用于服务路径) private static final List WHITE_LIST = Arrays.asList( "/fund/sys/auth/login", - "/fund/sys/health", - "/fund/cust/health", - "/fund/proj/health", - "/fund/exp/health", - "/fund/receipt/health", - "/fund/report/health", - "/fund/req/health", - "/fund/file/health" + "/fund/sys/sys/health", + "/fund/cust/cust/health", + "/fund/proj/proj/health", + "/fund/exp/exp/health", + "/fund/receipt/receipt/health", + "/fund/report/report/health", + "/fund/req/req/health", + "/fund/file/file/health" ); private final ReactiveTokenService reactiveTokenService; diff --git a/fund-gateway/src/main/resources/application.yml b/fund-gateway/src/main/resources/application.yml index ba3a9eb..c2af680 100644 --- a/fund-gateway/src/main/resources/application.yml +++ b/fund-gateway/src/main/resources/application.yml @@ -66,6 +66,7 @@ spring: - Path=/fund/sys/** filters: - StripPrefix=2 + - PrefixPath=/api/v1 # 客户管理服务 - id: fund-cust @@ -74,6 +75,7 @@ spring: - Path=/fund/cust/** filters: - StripPrefix=2 + - PrefixPath=/api/v1 # 项目管理服务 - id: fund-proj @@ -82,6 +84,7 @@ spring: - Path=/fund/proj/** filters: - StripPrefix=2 + - PrefixPath=/api/v1 # 用款申请服务 - id: fund-req @@ -90,6 +93,7 @@ spring: - Path=/fund/req/** filters: - StripPrefix=2 + - PrefixPath=/api/v1 # 支出管理服务 - id: fund-exp @@ -98,6 +102,7 @@ spring: - Path=/fund/exp/** filters: - StripPrefix=2 + - PrefixPath=/api/v1 # 收款管理服务 - id: fund-receipt @@ -106,6 +111,7 @@ spring: - Path=/fund/receipt/** filters: - StripPrefix=2 + - PrefixPath=/api/v1 # 报表服务 - id: fund-report @@ -114,6 +120,7 @@ spring: - Path=/fund/report/** filters: - StripPrefix=2 + - PrefixPath=/api/v1 # 文件服务 - id: fund-file @@ -122,6 +129,7 @@ spring: - Path=/fund/file/** filters: - StripPrefix=2 + - PrefixPath=/api/v1 # 多租户路由配置 tenant: