From 5d4cdd5c33c075ff59f2e7525759511342964a4b Mon Sep 17 00:00:00 2001 From: zhangjf Date: Tue, 17 Feb 2026 14:55:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20RateLimitConfig=E6=B7=BB=E5=8A=A0@Primar?= =?UTF-8?q?y=E6=B3=A8=E8=A7=A3=E8=A7=A3=E5=86=B3=E5=A4=9AKeyResolver?= =?UTF-8?q?=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fundplatform/gateway/config/RateLimitConfig.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fund-gateway/src/main/java/com/fundplatform/gateway/config/RateLimitConfig.java b/fund-gateway/src/main/java/com/fundplatform/gateway/config/RateLimitConfig.java index c276f75..cd6b2be 100644 --- a/fund-gateway/src/main/java/com/fundplatform/gateway/config/RateLimitConfig.java +++ b/fund-gateway/src/main/java/com/fundplatform/gateway/config/RateLimitConfig.java @@ -3,6 +3,7 @@ package com.fundplatform.gateway.config; import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; import reactor.core.publisher.Mono; /** @@ -12,9 +13,10 @@ import reactor.core.publisher.Mono; public class RateLimitConfig { /** - * 基于IP的限流Key解析器 + * 基于IP的限流Key解析器 (默认) */ @Bean + @Primary public KeyResolver ipKeyResolver() { return exchange -> { String ip = exchange.getRequest().getRemoteAddress() != null