jason 1 tahun lalu
induk
melakukan
964743b5de
1 mengubah file dengan 13 tambahan dan 1 penghapusan
  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);