restful调用优化

pull/1/head
tanghc 5 years ago
parent bddb668452
commit 0f0c1ec710
  1. 4
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/route/ZuulRouteRepository.java

@ -45,6 +45,10 @@ public class ZuulRouteRepository implements RouteRepository<ZuulTargetRoute> {
private ZuulTargetRoute clone(String path, ZuulTargetRoute zuulTargetRoute) { private ZuulTargetRoute clone(String path, ZuulTargetRoute zuulTargetRoute) {
Route targetRouteDefinition = zuulTargetRoute.getTargetRouteDefinition(); Route targetRouteDefinition = zuulTargetRoute.getTargetRouteDefinition();
String prefix = "/" + zuulTargetRoute.getServiceRouteInfo().getServiceId();
if (path.startsWith(prefix)) {
path = path.substring(prefix.length());
}
Route route = new Route( Route route = new Route(
targetRouteDefinition.getId() targetRouteDefinition.getId()
,path ,path

Loading…
Cancel
Save