fix: request body 判空
This commit is contained in:
parent
817f40979f
commit
fa11557b2c
|
@ -219,7 +219,7 @@ export default {
|
||||||
if (this.currentApi.request != null && this.currentApi.request != 'null' && this.currentApi.request != undefined) {
|
if (this.currentApi.request != null && this.currentApi.request != 'null' && this.currentApi.request != undefined) {
|
||||||
if (Object.prototype.toString.call(this.currentApi.request).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object') {
|
if (Object.prototype.toString.call(this.currentApi.request).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object') {
|
||||||
this.currentApi.request = JSON.parse(this.currentApi.request);
|
this.currentApi.request = JSON.parse(this.currentApi.request);
|
||||||
if (!this.currentApi.request.body.type) {
|
if (this.currentApi.request.body && !this.currentApi.request.body.type) {
|
||||||
let tempRequest = _.cloneDeep(this.currentApi.request);
|
let tempRequest = _.cloneDeep(this.currentApi.request);
|
||||||
tempRequest.body = {type: null};
|
tempRequest.body = {type: null};
|
||||||
this.currentApi.request = tempRequest;
|
this.currentApi.request = tempRequest;
|
||||||
|
|
Loading…
Reference in New Issue