fix(接口定义): 修复部分缺陷

This commit is contained in:
fit2-zhao 2020-12-17 16:08:42 +08:00
parent 3dda8e849d
commit 8408cf902c
4 changed files with 22 additions and 12 deletions

View File

@ -80,6 +80,18 @@
if (!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: {
runTest(data) {

View File

@ -199,16 +199,14 @@
}
},
created() {
if (this.parameters) {
if (this.parameters.length === 0 || this.parameters[this.parameters.length - 1].name) {
this.parameters.push(new KeyValue({
type: 'text',
enable: true,
required: true,
uuid: this.uuid(),
contentType: 'text/plain'
}));
}
if (this.parameters.length === 0 || this.parameters[this.parameters.length - 1].name) {
this.parameters.push(new KeyValue({
type: 'text',
enable: true,
required: true,
uuid: this.uuid(),
contentType: 'text/plain'
}));
}
}
}

View File

@ -94,7 +94,7 @@
saveApi(saveAs) {
this.$refs['httpForm'].validate((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"));
return false;
}

View File

@ -8,7 +8,7 @@
<ms-api-key-value :isShowEnable="false" :suggestions="headerSuggestions" :items="response.headers"/>
</el-tab-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 :label="$t('api_test.definition.request.status_code')" name="status_code" class="pane">