Browse Source

修改请求

xiewenjie 3 years ago
parent
commit
36f636cf6b

+ 5 - 2
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/ImportDataController.java

@@ -2,6 +2,7 @@ package com.fdkk.sxz.webApi.controller;
 
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.http.HttpRequest;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -1286,8 +1287,10 @@ public class ImportDataController extends BaseController {
 
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("obj", JSON.parseObject(data));
-
-        String result = OkHttpUtils.httpPostJson(buildUrl + "getLightInfo", jsonObject.toJSONString());
+        String result = HttpRequest.post(buildUrl + "getLightInfo")
+                .body(jsonObject.toString())
+                .execute().body();
+        //String result2 = OkHttpUtils.httpPostJson(buildUrl + "getLightInfo", jsonObject.toJSONString());
         ImportDataController.log.info("getLightInfo返回结果:" + result);
         JSONObject resultJson = JSON.parseObject(result);
         if (resultJson.containsKey("state") && "done".equals(resultJson.getString("state"))) {