#
Junjie
2023-08-30 c41fce4524aaf930da42d2b86a41f0ec8570c0a0
src/main/java/com/zy/common/utils/NyHttpUtils.java
@@ -5,6 +5,7 @@
import com.zy.common.model.NavigateNode;
import com.zy.core.model.command.NyShuttleHttpCommand;
import com.zy.core.model.protocol.NyShuttleProtocol;
import springfox.documentation.spring.web.json.Json;
import java.io.*;
import java.net.Socket;
@@ -303,14 +304,27 @@
                }
            } while (response != null);
//            System.out.println("Received response from server: " + sb);
             return JSON.parseObject(sb.toString());
            JSONObject result = JSON.parseObject(sb.toString());//得到响应结果集
            if (!result.get("msgType").equals("responseMsg")) {//不是响应内容
                return null;
            }
            JSONObject resultResponse = JSON.parseObject(result.get("response").toString());
            JSONObject resultHeader = JSON.parseObject(resultResponse.get("header").toString());
            int responseId = Integer.parseInt(resultHeader.get("responseId").toString());
            if (responseId != httpCommand.getRequest().getHeader().getRequestId()) {
                return null;//响应ID与请求ID不一致
            }
            return filterBodyData(result);//返回Body结果集
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    public static JSONObject filterData(JSONObject data) {
    public static JSONObject filterBodyData(JSONObject data) {
        Object response = data.get("response");
        if (response == null) {
            return null;