diff --git a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/TrxServiceImpl.java b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/TrxServiceImpl.java index 2deb8ee..ec23661 100644 --- a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/TrxServiceImpl.java +++ b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/TrxServiceImpl.java @@ -64,7 +64,9 @@ public class TrxServiceImpl implements TrxService { try { HttpRequest httpRequest = HttpRequest.get(url) .addHeaders(paramsMap); + httpRequest.cookie("ngx_cookie=" + ngxCookie); log.info("调用天融信获取随机字符串接口, url:" + httpRequest.getUrl() + "请求头:" + JSONObject.toJSONString(httpRequest.headers())); + log.info("调用天融信获取随机字符串接口, 请求信息:" + JSONObject.toJSONString(httpRequest)); HttpResponse response = httpRequest.execute(); result = JSONObject.parseObject(response.body()); if ("-1".equals(result.getString("result"))) { @@ -248,7 +250,8 @@ public class TrxServiceImpl implements TrxService { if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); } - return ip; + String[] parts = ip.split(":"); + return parts[0]; } }