pull/1/head
tanghc 5 years ago
parent 78c93578d9
commit 2f4c46dc16
  1. 7
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/route/GatewayRouteCache.java
  2. 1
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/AbstractConfiguration.java

@ -27,7 +27,12 @@ public class GatewayRouteCache extends BaseRouteCache<GatewayTargetRoute> {
protected GatewayTargetRoute buildTargetRoute(ServiceRouteInfo serviceRouteInfo, RouteDefinition routeDefinition) { protected GatewayTargetRoute buildTargetRoute(ServiceRouteInfo serviceRouteInfo, RouteDefinition routeDefinition) {
org.springframework.cloud.gateway.route.RouteDefinition targetRoute = new org.springframework.cloud.gateway.route.RouteDefinition(); org.springframework.cloud.gateway.route.RouteDefinition targetRoute = new org.springframework.cloud.gateway.route.RouteDefinition();
targetRoute.setId(routeDefinition.getId()); targetRoute.setId(routeDefinition.getId());
targetRoute.setUri(URI.create(routeDefinition.getUri() + "#" + routeDefinition.getPath())); String path = routeDefinition.getPath();
if (path != null && path.contains("{") && path.contains("}")) {
path = path.replace('{', '?');
path = path.replace('}', '?');
}
targetRoute.setUri(URI.create(routeDefinition.getUri() + "#" + path));
targetRoute.setOrder(routeDefinition.getOrder()); targetRoute.setOrder(routeDefinition.getOrder());
// 添加过滤器 // 添加过滤器
List<FilterDefinition> filterDefinitionList = routeDefinition.getFilters() List<FilterDefinition> filterDefinitionList = routeDefinition.getFilters()

@ -64,6 +64,7 @@ public class AbstractConfiguration implements ApplicationContextAware {
} }
@Bean @Bean
@ConditionalOnProperty("zuul.servlet-path")
PropertiesFactory propertiesFactory() { PropertiesFactory propertiesFactory() {
return new SopPropertiesFactory(); return new SopPropertiesFactory();
} }

Loading…
Cancel
Save