fix(接口定义): 修复部分缺陷
This commit is contained in:
parent
3dda8e849d
commit
8408cf902c
|
@ -80,6 +80,18 @@
|
||||||
if (!this.request.hashTree) {
|
if (!this.request.hashTree) {
|
||||||
this.request.hashTree = [];
|
this.request.hashTree = [];
|
||||||
}
|
}
|
||||||
|
// 处理导入数据缺失问题
|
||||||
|
if (this.response.body) {
|
||||||
|
let body = new Body();
|
||||||
|
Object.assign(body, this.response.body);
|
||||||
|
if (!body.binary) {
|
||||||
|
body.binary = [];
|
||||||
|
}
|
||||||
|
if (!body.kvs) {
|
||||||
|
body.kvs = [];
|
||||||
|
}
|
||||||
|
this.response.body = body;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
runTest(data) {
|
runTest(data) {
|
||||||
|
|
|
@ -199,16 +199,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.parameters) {
|
if (this.parameters.length === 0 || this.parameters[this.parameters.length - 1].name) {
|
||||||
if (this.parameters.length === 0 || this.parameters[this.parameters.length - 1].name) {
|
this.parameters.push(new KeyValue({
|
||||||
this.parameters.push(new KeyValue({
|
type: 'text',
|
||||||
type: 'text',
|
enable: true,
|
||||||
enable: true,
|
required: true,
|
||||||
required: true,
|
uuid: this.uuid(),
|
||||||
uuid: this.uuid(),
|
contentType: 'text/plain'
|
||||||
contentType: 'text/plain'
|
}));
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
saveApi(saveAs) {
|
saveApi(saveAs) {
|
||||||
this.$refs['httpForm'].validate((valid) => {
|
this.$refs['httpForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if(this.httpForm.path.match(/\s/)!=null){
|
if (this.httpForm.path && this.httpForm.path.match(/\s/) != null) {
|
||||||
this.$error(this.$t("api_test.definition.request.path_valid_info"));
|
this.$error(this.$t("api_test.definition.request.path_valid_info"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<ms-api-key-value :isShowEnable="false" :suggestions="headerSuggestions" :items="response.headers"/>
|
<ms-api-key-value :isShowEnable="false" :suggestions="headerSuggestions" :items="response.headers"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="$t('api_test.definition.request.response_body')" name="body" class="pane">
|
<el-tab-pane :label="$t('api_test.definition.request.response_body')" name="body" class="pane">
|
||||||
<ms-api-body :isShowEnable="false" :body="response.body" :headers="response.headers"/>
|
<ms-api-body :isReadOnly="false" :isShowEnable="false" :body="response.body" :headers="response.headers"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
<el-tab-pane :label="$t('api_test.definition.request.status_code')" name="status_code" class="pane">
|
<el-tab-pane :label="$t('api_test.definition.request.status_code')" name="status_code" class="pane">
|
||||||
|
|
Loading…
Reference in New Issue