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 4286128..0d75dc9 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 @@ -86,38 +86,38 @@ public class TrxServiceImpl implements TrxService { Map paramsMap = new HashMap<>(); paramsMap.put("cookie", trxAuthModel.getClientHello()); - List> authen = new ArrayList<>(); + List> authenList = new ArrayList<>(); Map userMap = new HashMap<>(); userMap.put("loginName", trxAuthModel.getLoginName()); userMap.put("passwd", trxAuthModel.getPasswd()); - authen.add(userMap); + authenList.add(userMap); Map md5Map = new HashMap<>(); md5Map.put("certMd5", trxAuthModel.getServerHello()); md5Map.put("value", ""); md5Map.put("hashType", ""); - authen.add(md5Map); + authenList.add(md5Map); Map passcodeMap = new HashMap<>(); passcodeMap.put("passcode", ""); - authen.add(passcodeMap); + authenList.add(passcodeMap); Map dfCodeMap = new HashMap<>(); dfCodeMap.put("df_code", ""); - authen.add(dfCodeMap); + authenList.add(dfCodeMap); Map ipMap = new HashMap<>(); ipMap.put("client_ip", trxAuthModel.getClientIp()); - authen.add(ipMap); - paramsMap.put("Authen", authen); + authenList.add(ipMap); + paramsMap.put("Authen", authenList); JSONObject result = new JSONObject(); GeneralResult> login = new GeneralResult<>(); try { - HttpRequest httpRequest = HttpRequest.post("http://your_backend_url/trx/userAuthen") + HttpRequest httpRequest = HttpRequest.post(url) .header("isToken", "false") .body(JSONObject.toJSONString(paramsMap)); - log.info("调用天融信获取随机字符串接口, 请求信息:" + JSONObject.toJSONString(httpRequest)); + log.info("调用天融信用户登录接口, 请求信息:" + JSONObject.toJSONString(httpRequest)); HttpResponse response = httpRequest.execute(); result = JSONObject.parseObject(response.body()); if (!"0".equals(result.getString("result"))) { @@ -225,7 +225,12 @@ public class TrxServiceImpl implements TrxService { Map paramsMap = new HashMap<>(); paramsMap.put("token", trxAuthModel.getTrxToken()); paramsMap.put("client_ip", trxAuthModel.getClientIp()); - JSONObject result = JSONObject.parseObject(HttpUtil.post(url, paramsMap)); + HttpRequest httpRequest = HttpRequest.post(url) + .header("isToken", "false") + .body(JSONObject.toJSONString(paramsMap)); + log.info("调用天融信下线接口, 请求信息:" + JSONObject.toJSONString(httpRequest)); + HttpResponse response = httpRequest.execute(); + JSONObject result = JSONObject.parseObject(response.body()); if (!"0".equals(result.getString("result"))) { return new GeneralResult(false, "下线失败" + result.getString("msg")); }