diff --git a/api-test/frontend/src/business/definition/components/list/ApiList.vue b/api-test/frontend/src/business/definition/components/list/ApiList.vue index ee5d7110ab..aa77dead91 100644 --- a/api-test/frontend/src/business/definition/components/list/ApiList.vue +++ b/api-test/frontend/src/business/definition/components/list/ApiList.vue @@ -273,7 +273,7 @@ import { initCondition } from "metersphere-frontend/src/utils/tableUtils"; import HeaderLabelOperate from "metersphere-frontend/src/components/head/HeaderLabelOperate"; -import {Body, KeyValue} from "@/business/definition/model/ApiTestModel"; +import {Body} from "@/business/definition/model/ApiTestModel"; import {getGraphByCondition} from "@/api/graph"; import ListItemDeleteConfirm from "metersphere-frontend/src/components/ListItemDeleteConfirm"; import MsSearch from "metersphere-frontend/src/components/search/MsSearch"; @@ -718,11 +718,6 @@ export default { } if (!item.request.headers) { item.request.headers = []; - } else if (item.request.headers.length === 1) { - let values = item.request.headers.filter(tab => tab.name !== ''); - if (values.length > 0) { - item.request.headers.push(new KeyValue({enable: true})) - } } if (!item.request.body.kvs) { item.request.body.kvs = []; @@ -736,12 +731,6 @@ export default { if (!item.request.rest) { item.request.rest = []; } - if (item.request.query && item.request.query.length === 1) { - let values = item.request.query.filter(tab => tab.name !== ''); - if (values.length > 0) { - item.request.query.push(new KeyValue({enable: true})) - } - } if (!item.request.arguments) { item.request.arguments = [{ contentType: "text/plain", diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/log/utils/ReflexObjectUtil.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/log/utils/ReflexObjectUtil.java index 677014c9c9..9e31c2ba0a 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/log/utils/ReflexObjectUtil.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/log/utils/ReflexObjectUtil.java @@ -177,7 +177,9 @@ public class ReflexObjectUtil { oldTags = StringUtils.join(StringUtils.join(JSON_START, ((originalColumns.get(i) != null && originalObject != null) ? originalObject.toString() : "\"\"")), JSON_END); } List newValueArray = JSON.parseArray(newValue.toString(), String.class); - Collections.sort(newValueArray); + if (CollectionUtils.isNotEmpty(newValueArray)) { + Collections.sort(newValueArray); + } Object newObject = JSON.toJSONString(newValueArray); String newTags = StringUtils.join(StringUtils.join(JSON_START, ((newColumns.get(i) != null && newObject != null) ? newObject.toString() : "\"\"")), JSON_END); String diffValue;