Commit 5e180d6f authored by 赵啸非's avatar 赵啸非

修改配置文件

parent 386511ab
......@@ -135,7 +135,6 @@ public class ProxyController {
req.remove("path");
String targetUrl = "http://127.0.0.1:11078/basics_api" + path; // 目标 URL
// 拼接 Query 参数
......@@ -182,12 +181,16 @@ public class ProxyController {
Map<String, Object> map = req.toJavaObject(Map.class);
/* String bodyParams = getBodyParams(map);
log.info(bodyParams);*/
String urlGet = HttpUtil.urlWithForm(url.toString(), map, Charset.forName("utf-8"), false);
String resp = HttpUtil.get(urlGet);
// String urlGet = HttpUtil.urlWithForm(url.toString(), map, Charset.forName("utf-8"), false);
try {
String resp = HttpUtil.get(url.toString(), map, 30 * 1000);
//String resp = HttpUtil.get(urlGet);
return Rest.ok("透传请求成功!", resp);
} catch (Exception e) {
rsp.setCode(ApiRespCodeEnum.FAILED.getValue());
rsp.setMsg("Proxy error: " + e.getMessage());
return Rest.fail(rsp.getMsg());
}
/* //url拼接参数
Request.Builder requestBuilder = new Request.Builder()
......@@ -252,7 +255,6 @@ public class ProxyController {
}
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