|
@@ -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);
|