fix(接口定义): 修复部分缺陷
This commit is contained in:
parent
3dda8e849d
commit
8408cf902c
|
@ -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) {
|
||||
|
|
|
@ -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'
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue