From f92318dc7a4bd73e89cbc1cd2600fa303463ac43 Mon Sep 17 00:00:00 2001 From: tanghc Date: Tue, 21 Jan 2020 08:50:57 +0800 Subject: [PATCH] 3.0.0 --- .../gatewaycommon/manager/DefaultLimitConfigManager.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/DefaultLimitConfigManager.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/DefaultLimitConfigManager.java index d7885087..0af913b8 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/DefaultLimitConfigManager.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/DefaultLimitConfigManager.java @@ -61,27 +61,23 @@ public class DefaultLimitConfigManager implements LimitConfigManager { */ protected Set buildKeys(ConfigLimitDto configLimitDto) { Set keys = new HashSet<>(); - Set baseKeys = new HashSet<>(); String routeId = Optional.ofNullable(configLimitDto.getRouteId()).orElse(""); String appKey = Optional.ofNullable(configLimitDto.getAppKey()).orElse(""); String limitIp = Optional.ofNullable(configLimitDto.getLimitIp()).orElse("").replaceAll("\\s", ""); - // 根据路由ID限流 if (StringUtils.isNotBlank(routeId) && StringUtils.isBlank(appKey) && StringUtils.isBlank(limitIp)) { keys.add(routeId); - baseKeys.add(routeId); } // 根据appKey限流 if (StringUtils.isBlank(routeId) && StringUtils.isNotBlank(appKey) && StringUtils.isBlank(limitIp)) { keys.add(appKey); - baseKeys.add(appKey); } // 根据路由ID + appKey限流 if (StringUtils.isNotBlank(routeId) && StringUtils.isNotBlank(appKey) && StringUtils.isBlank(limitIp)) { keys.add(routeId.trim() + appKey.trim()); - baseKeys.add(routeId.trim() + appKey.trim()); } + Set baseKeys = new HashSet<>(keys); // 根据ip限流 if (StringUtils.isBlank(routeId) && StringUtils.isBlank(appKey) && StringUtils.isNotBlank(limitIp)) { String[] ips = limitIp.split("\\,|\\,");