fix(接口测试): QUERY参数修改时变更记录修改有误
--bug=1026740 --user=宋昌昌 【接口测试】接口导入后-删除query参数-变更记录显示未变更的参数 https://www.tapd.cn/55049933/s/1386695
This commit is contained in:
parent
c32a767715
commit
e4b868a93f
|
@ -359,6 +359,9 @@ export default {
|
||||||
}
|
}
|
||||||
this.sort(data.request.hashTree);
|
this.sort(data.request.hashTree);
|
||||||
}
|
}
|
||||||
|
if (data.response) {
|
||||||
|
this.parseResponseStructureDefaultKeyValue(data.response);
|
||||||
|
}
|
||||||
updateDefinition(this.reqUrl, null, bodyFiles, data).then((response) => {
|
updateDefinition(this.reqUrl, null, bodyFiles, data).then((response) => {
|
||||||
this.$success(this.$t('commons.save_success'));
|
this.$success(this.$t('commons.save_success'));
|
||||||
this.reqUrl = '/api/definition/update';
|
this.reqUrl = '/api/definition/update';
|
||||||
|
@ -376,6 +379,26 @@ export default {
|
||||||
this.responseCount = 0;
|
this.responseCount = 0;
|
||||||
this.count = 0;
|
this.count = 0;
|
||||||
},
|
},
|
||||||
|
parseResponseStructureDefaultKeyValue(response) {
|
||||||
|
if (response.headers && response.headers.length === 1) {
|
||||||
|
let kv = response.headers[0];
|
||||||
|
if (!kv.name || !kv.value) {
|
||||||
|
response.headers = [];
|
||||||
|
}
|
||||||
|
if ((kv.name == null || kv.name === '') && (kv.value == null || kv.value === '')) {
|
||||||
|
response.headers = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (response.statusCode && response.statusCode.length === 1) {
|
||||||
|
let kv = response.statusCode[0];
|
||||||
|
if (!kv.name || !kv.value) {
|
||||||
|
response.statusCode = [];
|
||||||
|
}
|
||||||
|
if ((kv.name == null || kv.name === '') && (kv.value == null || kv.value === '')) {
|
||||||
|
response.statusCode = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
handleSave() {
|
handleSave() {
|
||||||
if (this.$refs.httpApi) {
|
if (this.$refs.httpApi) {
|
||||||
this.$refs.httpApi.saveApi();
|
this.$refs.httpApi.saveApi();
|
||||||
|
|
Loading…
Reference in New Issue