Commit 82a9e8f3 authored by 赵啸非's avatar 赵啸非

修改配置文件

parent 6798a6f6
......@@ -9,6 +9,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.util.UriBuilder;
import org.springframework.web.util.UriUtils;
import reactor.core.publisher.Mono;
......@@ -50,12 +51,14 @@ public class ProxyController {
params.remove("path");
String targetUrl = "http://127.0.0.1:11078/basic_api/" + path;
String targetUrl = "127.0.0.1:11078/basic_api/" + path;
log.info("proxyPost targetUrl: {}", targetUrl);
if ("post".equalsIgnoreCase(method)) {
return webClient.post()
.uri(uriBuilder -> {
uriBuilder.scheme("http");
uriBuilder.path(targetUrl);
params.forEach((key, value) ->
uriBuilder.queryParam(key, UriUtils.encode(value, StandardCharsets.UTF_8))
);
......@@ -73,4 +76,10 @@ public class ProxyController {
}
return Mono.just(ResponseEntity.ok().body(JSON.toJSONString(rsp)));
}
public static void main(String[] args) {
}
}
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