fix(接口定义): 修复更新接口,空白header存在的缺陷
--bug=1018152 --user=王孝刚 【接口测试】更新接口,日志里报错 https://www.tapd.cn/55049933/s/1267889
This commit is contained in:
parent
26b8c30e56
commit
1811af7e6e
|
@ -273,7 +273,7 @@ import {
|
||||||
initCondition
|
initCondition
|
||||||
} from "metersphere-frontend/src/utils/tableUtils";
|
} from "metersphere-frontend/src/utils/tableUtils";
|
||||||
import HeaderLabelOperate from "metersphere-frontend/src/components/head/HeaderLabelOperate";
|
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 {getGraphByCondition} from "@/api/graph";
|
||||||
import ListItemDeleteConfirm from "metersphere-frontend/src/components/ListItemDeleteConfirm";
|
import ListItemDeleteConfirm from "metersphere-frontend/src/components/ListItemDeleteConfirm";
|
||||||
import MsSearch from "metersphere-frontend/src/components/search/MsSearch";
|
import MsSearch from "metersphere-frontend/src/components/search/MsSearch";
|
||||||
|
@ -718,11 +718,6 @@ export default {
|
||||||
}
|
}
|
||||||
if (!item.request.headers) {
|
if (!item.request.headers) {
|
||||||
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) {
|
if (!item.request.body.kvs) {
|
||||||
item.request.body.kvs = [];
|
item.request.body.kvs = [];
|
||||||
|
@ -736,12 +731,6 @@ export default {
|
||||||
if (!item.request.rest) {
|
if (!item.request.rest) {
|
||||||
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) {
|
if (!item.request.arguments) {
|
||||||
item.request.arguments = [{
|
item.request.arguments = [{
|
||||||
contentType: "text/plain",
|
contentType: "text/plain",
|
||||||
|
|
|
@ -177,7 +177,9 @@ public class ReflexObjectUtil {
|
||||||
oldTags = StringUtils.join(StringUtils.join(JSON_START, ((originalColumns.get(i) != null && originalObject != null) ? originalObject.toString() : "\"\"")), JSON_END);
|
oldTags = StringUtils.join(StringUtils.join(JSON_START, ((originalColumns.get(i) != null && originalObject != null) ? originalObject.toString() : "\"\"")), JSON_END);
|
||||||
}
|
}
|
||||||
List<String> newValueArray = JSON.parseArray(newValue.toString(), String.class);
|
List<String> newValueArray = JSON.parseArray(newValue.toString(), String.class);
|
||||||
Collections.sort(newValueArray);
|
if (CollectionUtils.isNotEmpty(newValueArray)) {
|
||||||
|
Collections.sort(newValueArray);
|
||||||
|
}
|
||||||
Object newObject = JSON.toJSONString(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 newTags = StringUtils.join(StringUtils.join(JSON_START, ((newColumns.get(i) != null && newObject != null) ? newObject.toString() : "\"\"")), JSON_END);
|
||||||
String diffValue;
|
String diffValue;
|
||||||
|
|
Loading…
Reference in New Issue