This commit is contained in:
Lemon
2023-10-26 16:43:29 +08:00
parent 10d5636c56
commit 97370c731b
2 changed files with 10 additions and 4 deletions

View File

@@ -110,7 +110,7 @@ public class HttpRequestUtil {
byte[] encryptText = Cryptos.aesEncrypt(data.getBytes(),
dataSecret.getBytes(), dataSecretIV.getBytes());
String encryptData = Encodes.encodeBase64(encryptText);
System.out.println("加密数据:" + encryptData);
log.info("联联平台发送请求 加密数据:" + encryptData);
Map<String, String> params = Maps.newLinkedHashMap();
params.put("OperatorID", operatorId);
@@ -121,7 +121,7 @@ public class HttpRequestUtil {
params.put("Sig", sign);
String postData = JSON.toJSONString(params);
log.info("联联平台发送请求 最终提交数据:{}", postData);
log.info("联联平台发送请求 最终提交数据:{}, 加密数据:{}", params, postData);
// System.out.println("最终提交数据:" + postData);
String hutoolRequest = HttpRequest.post(url).header("Authorization", "Bearer " + token).body(postData).execute().body();
@@ -129,6 +129,9 @@ public class HttpRequestUtil {
log.info("联联平台发送请求 接收到返回数据:{}", hutoolRequest);
// System.out.println("接收到返回数据:" + hutoolRequest);
if (StringUtils.isBlank(hutoolRequest)) {
return "返回数据为空";
}
Map<String, Object> map = (Map<String, Object>) JSON.parse(hutoolRequest);
log.info("联联平台发送请求 返回数据map:{}", JSON.toJSONString(map));