diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue index 9fd73b8cb9..65898fe4b5 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue @@ -60,7 +60,7 @@ :new-show-follow="newShowFollow" :module-options="moduleOptions" :request="request" - :old-request="oldRequest" + :old-request="newRequest" > @@ -162,8 +162,8 @@ export default { newShowFollow: false, versionData: [], newData: {}, - oldRequest: {}, - oldResponse: {}, + newRequest: {}, + newResponse: {}, createNewVersionVisible: false, }; }, @@ -246,7 +246,7 @@ export default { this.dealWithTag(res.data); this.setRequest(res.data) if (!this.setRequest(res.data)) { - this.oldRequest = createComponent("DubboSampler"); + this.newRequest = createComponent("DubboSampler"); this.dialogVisible = true; } this.formatApi(res.data) @@ -258,12 +258,12 @@ export default { setRequest(api) { if (api.request !== undefined) { if (Object.prototype.toString.call(api.request).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { - this.oldRequest = api.request; + this.newRequest = api.request; } else { - this.oldRequest = JSON.parse(api.request); + this.newRequest = JSON.parse(api.request); } - if (!this.oldRequest.headers) { - this.oldRequest.headers = []; + if (!this.newRequest.headers) { + this.newRequest.headers = []; } this.dialogVisible = true; return true; @@ -285,23 +285,23 @@ export default { formatApi(api) { if (api.response != null && api.response !== 'null' && api.response !== undefined) { if (Object.prototype.toString.call(api.response).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { - this.oldResponse = api.response; + this.newResponse = api.response; } else { - this.oldResponse = JSON.parse(api.response); + this.newResponse = JSON.parse(api.response); } } else { - this.oldResponse = {headers: [], body: new Body(), statusCode: [], type: "HTTP"}; + this.newResponse = {headers: [], body: new Body(), statusCode: [], type: "HTTP"}; } - if (!this.oldRequest.hashTree) { - this.oldRequest.hashTree = []; + if (!this.newRequest.hashTree) { + this.newRequest.hashTree = []; } - if (this.oldRequest.body && !this.oldRequest.body.binary) { - this.oldRequest.body.binary = []; + if (this.newRequest.body && !this.newRequest.body.binary) { + this.newRequest.body.binary = []; } // 处理导入数据缺失问题 - if (this.oldResponse.body) { + if (this.newResponse.body) { let body = new Body(); - Object.assign(body, this.oldResponse.body); + Object.assign(body, this.newResponse.body); if (!body.binary) { body.binary = []; } @@ -311,11 +311,11 @@ export default { if (!body.binary) { body.binary = []; } - this.oldResponse.body = body; + this.newResponse.body = body; } - this.oldRequest.clazzName = TYPE_TO_C.get(this.oldRequest.type); + this.newRequest.clazzName = TYPE_TO_C.get(this.newRequest.type); - this.sort(this.oldRequest.hashTree); + this.sort(this.newRequest.hashTree); }, sort(stepArray) { if (stepArray) { diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue index a5689ef697..9d77d85763 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue @@ -151,10 +151,10 @@ :rule="rule" :maintainer-options="maintainerOptions" :module-options="moduleOptions" - :request="request" - :old-request="oldRequest" - :response="response" - :old-response="oldResponse" + :request="newRequest" + :old-request="request" + :response="newResponse" + :old-response="response" > @@ -258,8 +258,8 @@ export default { newMockBaseUrl: "", count: 0, versionData: [], - oldRequest: Sampler, - oldResponse: {}, + newRequest:Sampler, + newResponse:{}, createNewVersionVisible: false, }; }, @@ -572,7 +572,7 @@ export default { this.dealWithTag(res.data); this.setRequest(res.data); if (!this.setRequest(res.data)) { - this.oldRequest = createComponent("HTTPSamplerProxy"); + this.newRequest = createComponent("HTTPSamplerProxy"); this.dialogVisible = true; } this.formatApi(res.data); @@ -583,12 +583,12 @@ export default { setRequest(api) { if (api.request !== undefined) { if (Object.prototype.toString.call(api.request).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { - this.oldRequest = api.request; + this.newRequest = api.request; } else { - this.oldRequest = JSON.parse(api.request); + this.newRequest = JSON.parse(api.request); } - if (!this.oldRequest.headers) { - this.oldRequest.headers = []; + if (!this.newRequest.headers) { + this.newRequest.headers = []; } this.dialogVisible = true; return true; @@ -610,23 +610,23 @@ export default { formatApi(api) { if (api.response != null && api.response !== 'null' && api.response !== undefined) { if (Object.prototype.toString.call(api.response).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { - this.oldResponse = api.response; + this.newResponse = api.response; } else { - this.oldResponse = JSON.parse(api.response); + this.newResponse = JSON.parse(api.response); } } else { - this.oldResponse = {headers: [], body: new Body(), statusCode: [], type: "HTTP"}; + this.newResponse = {headers: [], body: new Body(), statusCode: [], type: "HTTP"}; } - if (!this.oldRequest.hashTree) { - this.oldRequest.hashTree = []; + if (!this.newRequest.hashTree) { + this.newRequest.hashTree = []; } - if (this.oldRequest.body && !this.oldRequest.body.binary) { - this.oldRequest.body.binary = []; + if (this.newRequest.body && !this.newRequest.body.binary) { + this.newRequest.body.binary = []; } // 处理导入数据缺失问题 - if (this.oldResponse.body) { + if (this.newResponse.body) { let body = new Body(); - Object.assign(body, this.oldResponse.body); + Object.assign(body, this.newResponse.body); if (!body.binary) { body.binary = []; } @@ -636,11 +636,11 @@ export default { if (!body.binary) { body.binary = []; } - this.oldResponse.body = body; + this.newResponse.body = body; } - this.oldRequest.clazzName = TYPE_TO_C.get(this.oldRequest.type); + this.newRequest.clazzName = TYPE_TO_C.get(this.newRequest.type); - this.sort(this.oldRequest.hashTree); + this.sort(this.newRequest.hashTree); }, sort(stepArray) { if (stepArray) { @@ -662,8 +662,6 @@ export default { }, cancelCreateNewVersion() { this.createNewVersionVisible = false; - // this.httpForm.versionId = row.id; - // this.httpForm.versionName = row.name; this.getVersionHistory(); }, checkout(row) { diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue index 5c72cc20e4..33c7b46fa0 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue @@ -60,8 +60,8 @@ :new-data="newData" :new-show-follow="newShowFollow" :module-options="moduleOptions" - :request="request" - :old-request="oldRequest" + :request="newRequest" + :old-request="request" > @@ -150,8 +150,8 @@ export default { newShowFollow: false, versionData: [], newData: {}, - oldRequest: {}, - oldResponse: {}, + newRequest: {}, + newResponse: {}, createNewVersionVisible: false, }; }, @@ -249,9 +249,9 @@ export default { this.dealWithTag(res.data); this.setRequest(res.data) if (!this.setRequest(res.data)) { - this.oldRequest = createComponent("JDBCSampler"); - if (!this.oldRequest.variables) { - this.oldRequest.variables = []; + this.newRequest = createComponent("JDBCSampler"); + if (!this.newRequest.variables) { + this.newRequest.variables = []; } this.dialogVisible = true } @@ -264,12 +264,12 @@ export default { setRequest(api) { if (api.request !== undefined) { if (Object.prototype.toString.call(api.request).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { - this.oldRequest = api.request; + this.newRequest = api.request; } else { - this.oldRequest = JSON.parse(api.request); + this.newRequest = JSON.parse(api.request); } - if (!this.oldRequest.headers) { - this.oldRequest.headers = []; + if (!this.newRequest.headers) { + this.newRequest.headers = []; } this.dialogVisible = true return true; @@ -291,23 +291,23 @@ export default { formatApi(api) { if (api.response != null && api.response !== 'null' && api.response !== undefined) { if (Object.prototype.toString.call(api.response).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { - this.oldResponse = api.response; + this.newResponse = api.response; } else { - this.oldResponse = JSON.parse(api.response); + this.newResponse = JSON.parse(api.response); } } else { - this.oldResponse = {headers: [], body: new Body(), statusCode: [], type: "HTTP"}; + this.newResponse = {headers: [], body: new Body(), statusCode: [], type: "HTTP"}; } - if (!this.oldRequest.hashTree) { - this.oldRequest.hashTree = []; + if (!this.newRequest.hashTree) { + this.newRequest.hashTree = []; } - if (this.oldRequest.body && !this.oldRequest.body.binary) { - this.oldRequest.body.binary = []; + if (this.newRequest.body && !this.newRequest.body.binary) { + this.newRequest.body.binary = []; } // 处理导入数据缺失问题 - if (this.oldResponse.body) { + if (this.newResponse.body) { let body = new Body(); - Object.assign(body, this.oldResponse.body); + Object.assign(body, this.newResponse.body); if (!body.binary) { body.binary = []; } @@ -317,10 +317,10 @@ export default { if (!body.binary) { body.binary = []; } - this.oldResponse.body = body; + this.newResponse.body = body; } - this.oldRequest.clazzName = TYPE_TO_C.get(this.oldRequest.type); - this.sort(this.oldRequest.hashTree); + this.newRequest.clazzName = TYPE_TO_C.get(this.newRequest.type); + this.sort(this.newRequest.hashTree); }, sort(stepArray) { if (stepArray) { diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue index 3a0f327948..8bd9a737ec 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue @@ -89,11 +89,11 @@ :new-data="newData" :new-show-follow="newShowFollow" :module-options="moduleOptions" - :request="request" - :old-request="oldRequest" + :request="newRequest" + :old-request="request" :mock-info="mockInfo" :api-protocol="apiProtocol" - :old-api-protocol="oldApiProtocol" + :old-api-protocol="newApiProtocol" :show-xpack-compnent="showXpackCompnent" :method-types="methodTypes" > @@ -176,9 +176,9 @@ export default { dialogVisible: false, newShowFollow: false, newData: {}, - oldRequest: {}, - oldResponse: {}, - oldApiProtocol: "TCP", + newRequest: {}, + newResponse: {}, + newApiProtocol: "TCP", createNewVersionVisible: false, }; }, @@ -369,14 +369,14 @@ export default { if (this.newData.method !== 'TCP' && this.newData.method !== 'ESB') { this.newData.method = this.newData.protocol; } - this.oldApiProtocol = this.basisData.method; - if (this.oldApiProtocol == null || this.oldApiProtocol === "") { - this.oldApiProtocol = "TCP"; + this.newApiProtocol = this.basisData.method; + if (this.newApiProtocol == null || this.newApiProtocol === "") { + this.newApiProtocol = "TCP"; } this.dealWithTag(res.data); this.setRequest(res.data) if (!this.setRequest(res.data)) { - this.oldRequest = createComponent("TCPSampler"); + this.newRequest = createComponent("TCPSampler"); this.dialogVisible = true; } this.formatApi(res.data) @@ -388,12 +388,12 @@ export default { setRequest(api) { if (api.request !== undefined) { if (Object.prototype.toString.call(api.request).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { - this.oldRequest = api.request; + this.newRequest = api.request; } else { - this.oldRequest = JSON.parse(api.request); + this.newRequest = JSON.parse(api.request); } - if (!this.oldRequest.headers) { - this.oldRequest.headers = []; + if (!this.newRequest.headers) { + this.newRequest.headers = []; } this.dialogVisible = true; return true; @@ -415,23 +415,23 @@ export default { formatApi(api) { if (api.response != null && api.response !== 'null' && api.response !== undefined) { if (Object.prototype.toString.call(api.response).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { - this.oldResponse = api.response; + this.newResponse = api.response; } else { - this.oldResponse = JSON.parse(api.response); + this.newResponse = JSON.parse(api.response); } } else { - this.oldResponse = {headers: [], body: new Body(), statusCode: [], type: "HTTP"}; + this.newResponse = {headers: [], body: new Body(), statusCode: [], type: "HTTP"}; } - if (!this.oldRequest.hashTree) { - this.oldRequest.hashTree = []; + if (!this.newRequest.hashTree) { + this.newRequest.hashTree = []; } - if (this.oldRequest.body && !this.oldRequest.body.binary) { - this.oldRequest.body.binary = []; + if (this.newRequest.body && !this.newRequest.body.binary) { + this.newRequest.body.binary = []; } // 处理导入数据缺失问题 - if (this.oldResponse.body) { + if (this.newResponse.body) { let body = new Body(); - Object.assign(body, this.oldResponse.body); + Object.assign(body, this.newResponse.body); if (!body.binary) { body.binary = []; } @@ -441,11 +441,11 @@ export default { if (!body.binary) { body.binary = []; } - this.oldResponse.body = body; + this.newResponse.body = body; } - this.oldRequest.clazzName = TYPE_TO_C.get(this.oldRequest.type); + this.newRequest.clazzName = TYPE_TO_C.get(this.newRequest.type); - this.sort(this.oldRequest.hashTree); + this.sort(this.newRequest.hashTree); }, sort(stepArray) { if (stepArray) {