Commit 4f392e03 authored by 赵啸非's avatar 赵啸非

回退站点业务请求列表

parent 25f25ef3
...@@ -162,14 +162,38 @@ public class MidSignApiController { ...@@ -162,14 +162,38 @@ public class MidSignApiController {
log.info("mid resp:" + bodyJson.toJSONString()); log.info("mid resp:" + bodyJson.toJSONString());
return Rest.ok(bodyJson.toJSONString()); return Rest.ok(bodyJson.toJSONString());
} else { } else {
//sha加密提交 //sha加密提交
String fullUrl = midUrl + midReq.getPath(); String fullUrl = midUrl + midReq.getPath();
log.info("mid url:{},body:{}", fullUrl, headerMap.get("body"));
String body = HttpUtil.createRequest(Method.POST, fullUrl).headerMap(headerMap, true).body(headerMap.get("body")).execute().body(); if ("post".equalsIgnoreCase(midReq.getMethod())) {
JSONObject bodyJson = JSONObject.parseObject(body); log.info("mid post url:{},body:{}", fullUrl, headerMap.get("body"));
log.info("mid resp:" + bodyJson.toJSONString()); String body = HttpUtil.createRequest(Method.POST, fullUrl).headerMap(headerMap, true).body(headerMap.get("body")).execute().body();
return Rest.ok(bodyJson.toJSONString()); JSONObject bodyJson = JSONObject.parseObject(body);
log.info("mid resp:" + bodyJson.toJSONString());
return Rest.ok(bodyJson.toJSONString());
} else if ("get".equalsIgnoreCase(midReq.getMethod())) {
Map<String, Object> paramsMap = JSON.parseObject(midReq.getBody(), HashMap.class);
log.info("mid get url:{},body:{}", fullUrl, JSON.toJSONString(paramsMap));
// if (!paramsMap.isEmpty()) {
// for (Map.Entry<String, Object> entry : paramsMap.entrySet()) {
// headerMap.put(entry.getKey(), entry.getValue());
// }
// }
String body = HttpUtil.createRequest(Method.GET, fullUrl).headerMap(headerMap, true).form(paramsMap).execute().body();
JSONObject bodyJson = JSONObject.parseObject(body);
log.info("mid resp:" + bodyJson.toJSONString());
return Rest.ok(bodyJson.toJSONString());
}else{
log.info("mid post url:{},body:{}", fullUrl, headerMap.get("body"));
String body = HttpUtil.createRequest(Method.POST, fullUrl).headerMap(headerMap, true).body(headerMap.get("body")).execute().body();
JSONObject bodyJson = JSONObject.parseObject(body);
log.info("mid resp:" + bodyJson.toJSONString());
return Rest.ok(bodyJson.toJSONString());
}
} }
} catch (Exception e) { } catch (Exception e) {
log.error("透传请求异常", e); log.error("透传请求异常", e);
......
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