diff --git a/frontend/src/business/components/api/definition/components/mock/Components/MockResponseParam.vue b/frontend/src/business/components/api/definition/components/mock/Components/MockResponseParam.vue index b9a1d37901..8f2518f662 100644 --- a/frontend/src/business/components/api/definition/components/mock/Components/MockResponseParam.vue +++ b/frontend/src/business/components/api/definition/components/mock/Components/MockResponseParam.vue @@ -105,6 +105,12 @@ export default { if (!this.response || !this.response || !this.response.headers) { return; } + if(!this.response.httpCode || this.response.httpCode === ''){ + this.$set(this.response,"httpCode","200"); + } + if(!this.response.delayed){ + this.response.delayed = 0; + } if (Object.prototype.toString.call(this.response).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object') { this.response = JSON.parse(this.response); } diff --git a/frontend/src/business/components/api/definition/components/mock/MockEditDrawer.vue b/frontend/src/business/components/api/definition/components/mock/MockEditDrawer.vue index 6ce01a8d96..017d7bb2b2 100644 --- a/frontend/src/business/components/api/definition/components/mock/MockEditDrawer.vue +++ b/frontend/src/business/components/api/definition/components/mock/MockEditDrawer.vue @@ -100,10 +100,10 @@ export default { }, response: { httpCode: "", - delayed: "", httpHeads: [], body: "", responseResult:{ + delayed: 0, headers:[], arguments:[], rest:[], @@ -234,6 +234,18 @@ export default { uploadMockExpectConfig(clearForm) { let url = "/mockConfig/updateMockExpectConfig"; let param = this.mockExpectConfig; + if(!param.name || param.name === ''){ + this.$error(this.$t('test_track.case.input_name')); + return false; + }else if(param.name.length > 100){ + this.$error(this.$t('test_track.length_less_than')+100); + return false; + } + + if(!param.response.responseResult.httpCode){ + param.response.responseResult.httpCode = 200; + } + if(!param.request.params.id){ param.request.params.id = getUUID(); }