Commit 7309a853 authored by 赵啸非's avatar 赵啸非

修改配置文件

parent 6b19ce7d
...@@ -52,10 +52,22 @@ public class ProxyController { ...@@ -52,10 +52,22 @@ public class ProxyController {
params.remove("path"); params.remove("path");
String targetUrl = "127.0.0.1:11078/basic_api/" + path; String targetUrl = "http://127.0.0.1:11078/basic_api/" + path;
String targetPath = "/basic_api" + path;
log.info("proxyPost targetUrl: {}", targetUrl); log.info("proxyPost targetUrl: {}", targetUrl);
if ("post".equalsIgnoreCase(method)) { if ("post".equalsIgnoreCase(method)) {
return webClient.post() return webClient.post()
.uri(uriBuilder -> {
uriBuilder
.scheme("http")
.host("127.0.0.1:11078")
.path(targetPath);
params.forEach((key, value) ->
uriBuilder.queryParam(key, UriUtils.encode(value, StandardCharsets.UTF_8))
);
return uriBuilder.build();
})
/* .uri(uriBuilder -> { /* .uri(uriBuilder -> {
uriBuilder.scheme("http"); uriBuilder.scheme("http");
uriBuilder.path(targetUrl); uriBuilder.path(targetUrl);
...@@ -66,7 +78,6 @@ public class ProxyController { ...@@ -66,7 +78,6 @@ public class ProxyController {
log.info("proxyPost uriBuilder: {}", uriBuilder.build()); log.info("proxyPost uriBuilder: {}", uriBuilder.build());
return uriBuilder.build(); return uriBuilder.build();
})*/ })*/
.uri(URI.create(targetUrl))
.headers(httpHeaders -> headers.forEach(httpHeaders::set)) .headers(httpHeaders -> headers.forEach(httpHeaders::set))
.bodyValue(body != null ? body : "") // 透传 Body .bodyValue(body != null ? body : "") // 透传 Body
.retrieve() .retrieve()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment