jason 1 年之前
父节点
当前提交
964743b5de
共有 1 个文件被更改,包括 13 次插入1 次删除
  1. 13 1
      APIVisit.java

+ 13 - 1
APIVisit.java

@@ -86,7 +86,19 @@ public class APIVisit {
             // http 设置和请求
             HttpClient client = HttpClientBuilder.create().build();
             URIBuilder uriBuilder = new URIBuilder(url);
-            uriBuilder.setParameter("data", data);
+            if (enc) {
+                String data = "";
+                JSONObject jobj = JSONObject.fromObject(param);
+                data = jobj.toString();
+                data = AesEcbEncrypt(data, secret);
+                uriBuilder.setParameter("data", data);
+            } else {
+                param.entrySet().forEach(item -> {
+                        uriBuilder.setParameter(item.getKey(), item.getValue());
+                        System.out.println("key:" + item.getKey() + ",vaule:" + item.getValue());
+                    });
+            }
+
             URI reqUrl = uriBuilder.build();
             HttpGet request = new HttpGet(reqUrl);
             request.setHeader("token", token);