浏览代码

加密逻辑更新

yuhongqi 1 月之前
父节点
当前提交
e0ac962344
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      fs-service-system/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

+ 8 - 4
fs-service-system/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -2905,11 +2905,15 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
     private void getPhoneByHttp(LiveOrder liveOrder) {
         try {
             String encryptedStr = CrossServiceRsaUtil.encryptForRequest("phone");
-            String url = "http://42.194.245.189:8010/app/common/getEncryptedPhone?encryptedStr="
-                    + java.net.URLEncoder.encode(encryptedStr, "UTF-8")
-                    + "&addressId=" + liveOrder.getAddressId();
+            String url = "http://42.194.245.189:8010/app/common/getEncryptedPhone";
             org.springframework.web.client.RestTemplate restTemplate = new org.springframework.web.client.RestTemplate();
-            String responseBody = restTemplate.getForObject(url, String.class);
+            java.util.Map<String, Object> paramMap = new java.util.HashMap<>();
+            paramMap.put("encryptedStr", encryptedStr);
+            paramMap.put("addressId", liveOrder.getAddressId());
+            org.springframework.http.HttpHeaders headers = new org.springframework.http.HttpHeaders();
+            headers.setContentType(org.springframework.http.MediaType.APPLICATION_JSON);
+            org.springframework.http.HttpEntity<java.util.Map<String, Object>> requestEntity = new org.springframework.http.HttpEntity<>(paramMap, headers);
+            String responseBody = restTemplate.postForObject(url, requestEntity, String.class);
             if (StringUtils.isNotEmpty(responseBody)) {
                 com.alibaba.fastjson.JSONObject respObj = com.alibaba.fastjson.JSON.parseObject(responseBody);
                 if (respObj != null && "200".equals(respObj.getString("code"))) {