diff --git a/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue b/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue index a43d5f6373..315c9cc70e 100644 --- a/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue +++ b/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue @@ -172,14 +172,6 @@ - @@ -237,7 +229,6 @@ export default { MsDubboBasisParameters: () => import('../../../definition/components/request/dubbo/BasisParameters'), MsApiRequestForm: () => import('../../../definition/components/request/http/ApiHttpRequestForm'), MsRequestResultTail: () => import('../../../definition/components/response/RequestResultTail'), - MsRun: () => import('../../../definition/components/Run'), }, data() { return { @@ -480,7 +471,7 @@ export default { // 场景变量 let variables = []; if (this.currentScenario && this.currentScenario.variables) { - variables = JSON.parse(JSON.stringify(this.currentScenario.variables)); + variables = this.currentScenario.variables; } let debugData = { id: this.currentScenario.id, @@ -518,6 +509,9 @@ export default { this.request.result = undefined; /*触发执行操作*/ this.reportId = getUUID(); + debugData.hashTree = [this.request]; + debugData.stepScenario = true; + this.$emit('runScenario', debugData); } }); }, diff --git a/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue b/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue index 3692692678..feb7dba16b 100644 --- a/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue +++ b/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue @@ -193,7 +193,7 @@ export default { } this.scenario.run = true; let runScenario = JSON.parse(JSON.stringify(this.scenario)); - let variables = JSON.parse(JSON.stringify(this.currentScenario.variables)); + let variables = this.currentScenario.variables; // 合并自身依赖场景变量 if (runScenario && runScenario.variableEnable && runScenario.variables) { diff --git a/api-test/frontend/src/business/definition/components/assertion/ApiJsonpathSuggest.vue b/api-test/frontend/src/business/definition/components/assertion/ApiJsonpathSuggest.vue index 3539291c59..8a42ef9244 100644 --- a/api-test/frontend/src/business/definition/components/assertion/ApiJsonpathSuggest.vue +++ b/api-test/frontend/src/business/definition/components/assertion/ApiJsonpathSuggest.vue @@ -73,7 +73,7 @@ export default { open(objStr) { this.data = {}; try { - let stringedJSON = objStr.replace(/:\s*(?!.*\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}\+\d{2}:\d{2})\s([-+Ee0-9.]+)/g, ': "$1"'); + let stringedJSON = objStr.replace(/(?<=[:\[,])\s*(-?\d+(\.\d+)?)(?=\s*([,\]}]))/g, '"$1"'); let param; let JSONBig = require('json-bigint')({ storeAsString: true }); // 解决精度丢失问题 diff --git a/framework/sdk-parent/frontend/src/components/environment/assertion/ApiJsonpathSuggest.vue b/framework/sdk-parent/frontend/src/components/environment/assertion/ApiJsonpathSuggest.vue index baa3cec1b3..ba79e1407c 100644 --- a/framework/sdk-parent/frontend/src/components/environment/assertion/ApiJsonpathSuggest.vue +++ b/framework/sdk-parent/frontend/src/components/environment/assertion/ApiJsonpathSuggest.vue @@ -69,7 +69,7 @@ export default { open(objStr) { this.data = {}; try { - let stringedJSON = objStr.replace(/:\s*(?!.*\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}\+\d{2}:\d{2})\s([-+Ee0-9.]+)/g, ': "$1"'); + let stringedJSON = objStr.replace(/(?<=[:\[,])\s*(-?\d+(\.\d+)?)(?=\s*([,\]}]))/g, '"$1"'); let param; let JSONBig = require('json-bigint')({"storeAsString": true}); // 解决精度丢失问题