fix default body type.

This commit is contained in:
xiawenlong
2021-10-19 20:40:26 +08:00
parent d4133f4128
commit f02595167f
6 changed files with 27 additions and 4 deletions
+12
View File
@@ -16,6 +16,7 @@ var app = new Vue({
params: "",
defaultHeader: {field: '', required: '', desc: ''},
attr: [],
attrType: 'formData',
api
},
created() {
@@ -25,6 +26,7 @@ var app = new Vue({
if(api.params.header && api.params.header.length > 0) this.header = api.params.header
if(api.params.query && api.params.query.length > 0) this.queryP = api.params.query
if(api.params.params && api.params.params.length > 0) this.attr = api.params.params
if(api.params.paramsType) this.attrType = api.params.paramsType
this.setParams();
}
},
@@ -46,12 +48,21 @@ var app = new Vue({
this.setParams()
},
deep: true
},
attrType: {
handler() {
this.setParams()
},
deep: true
}
},
methods: {
changeAttr(val) {
this.body = val
},
changeType(val) {
this.attrType = val
},
changeRes(val) {
val = this.filterParams(val)
this.response = JSON.stringify(val)
@@ -63,6 +74,7 @@ var app = new Vue({
const params = {
header: header,
params: body,
paramsType: this.attrType,
query: queryP,
}
this.params = JSON.stringify(params);