From 912649a48d61261b6e4e473fda779899955339ec Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 6 Apr 2023 18:51:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8E=BB=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1011681 --user=王孝刚 接口测试批量添加请求参数时自动去空格 https://www.tapd.cn/55049933/s/1359910 --- .../business/automation/scenario/variable/VariableList.vue | 2 +- .../definition/components/basis/BatchAddParameterButton.vue | 2 +- .../src/business/definition/components/body/ApiBody.vue | 4 ++-- .../definition/components/request/http/ApiHttpRequestForm.vue | 2 +- .../src/components/environment/EnvironmentHttpConfig.vue | 2 +- .../components/environment/commons/ApiScenarioVariables.vue | 2 +- .../menu/environment/components/EnvironmentHttpConfig.vue | 4 ++-- .../plan/view/comonents/report/detail/api/ApiBody.vue | 4 ++-- .../src/business/module/environment/EnvironmentHttpConfig.vue | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/api-test/frontend/src/business/automation/scenario/variable/VariableList.vue b/api-test/frontend/src/business/automation/scenario/variable/VariableList.vue index 8f52f08c7e..2cc0bfd4a6 100644 --- a/api-test/frontend/src/business/automation/scenario/variable/VariableList.vue +++ b/api-test/frontend/src/business/automation/scenario/variable/VariableList.vue @@ -336,7 +336,7 @@ export default { params.forEach((item) => { if (item) { let line = item.split(/:|:/); - let values = item.substr(line[0].length + 1); + let values = item.substr(line[0].length + 1).trim(); let required = false; keyValues.push( new KeyValue({ diff --git a/api-test/frontend/src/business/definition/components/basis/BatchAddParameterButton.vue b/api-test/frontend/src/business/definition/components/basis/BatchAddParameterButton.vue index 89597802bf..debc0094db 100644 --- a/api-test/frontend/src/business/definition/components/basis/BatchAddParameterButton.vue +++ b/api-test/frontend/src/business/definition/components/basis/BatchAddParameterButton.vue @@ -19,7 +19,7 @@ export default { let keyValues = []; params.forEach((item) => { let line = item.split(/:|:/); - let values = item.substr(line[0].length + 1); + let values = item.substr(line[0].length + 1).trim(); let required = false; if (line[1] === '必填' || line[1] === 'Required' || line[1] === 'true') { required = true; diff --git a/api-test/frontend/src/business/definition/components/body/ApiBody.vue b/api-test/frontend/src/business/definition/components/body/ApiBody.vue index 87acc277a6..baceb42f6b 100644 --- a/api-test/frontend/src/business/definition/components/body/ApiBody.vue +++ b/api-test/frontend/src/business/definition/components/body/ApiBody.vue @@ -355,8 +355,8 @@ export default { params.forEach((item) => { if (item) { let line = []; - line[0] = item.substring(0, item.indexOf(':')); - line[1] = item.substring(item.indexOf(':') + 1, item.length); + line[0] = item.substring(0, item.indexOf(/:|:/)).trim(); + line[1] = item.substring(item.indexOf(/:|:/) + 1, item.length).trim(); let required = false; keyValues.push( new KeyValue({ diff --git a/api-test/frontend/src/business/definition/components/request/http/ApiHttpRequestForm.vue b/api-test/frontend/src/business/definition/components/request/http/ApiHttpRequestForm.vue index c6e578ee92..28d63d949e 100644 --- a/api-test/frontend/src/business/definition/components/request/http/ApiHttpRequestForm.vue +++ b/api-test/frontend/src/business/definition/components/request/http/ApiHttpRequestForm.vue @@ -512,7 +512,7 @@ export default { params.forEach((item) => { if (item) { let line = item.split(/:|:/); - let values = item.substr(line[0].length +1); + let values = item.substr(line[0].length +1).trim(); let required = false; keyValues.push( diff --git a/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue b/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue index f983c5fcf0..8adacbd689 100644 --- a/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue +++ b/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue @@ -477,7 +477,7 @@ export default { params.forEach(item => { if (item) { let line = item.split(/:|:/); - let values = item.substr(line[0].length + 1); + let values = item.substr(line[0].length + 1).trim(); let required = false; keyValues.push(new KeyValue({ name: line[0], diff --git a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue index b4c205de28..75be75ffd1 100644 --- a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue +++ b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue @@ -436,7 +436,7 @@ export default { params.forEach((item) => { if (item) { let line = item.split(/:|:/); - let values = item.substr(line[0].length + 1); + let values = item.substr(line[0].length + 1).trim(); let required = false; keyValues.push( new KeyValue({ diff --git a/project-management/frontend/src/business/menu/environment/components/EnvironmentHttpConfig.vue b/project-management/frontend/src/business/menu/environment/components/EnvironmentHttpConfig.vue index 8ce0b24331..464bf407f6 100644 --- a/project-management/frontend/src/business/menu/environment/components/EnvironmentHttpConfig.vue +++ b/project-management/frontend/src/business/menu/environment/components/EnvironmentHttpConfig.vue @@ -485,12 +485,12 @@ export default { params.forEach(item => { if (item) { let line = item.split(/:|:/); - let values = item.split(line[0] + ":"); + let values = item.substr(line[0].length +1).trim(); let required = false; keyValues.push(new KeyValue({ name: line[0], required: required, - value: values[1], + value: values, type: "text", valid: false, file: false, diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/api/ApiBody.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/api/ApiBody.vue index 19f4d362c5..ee8cd5e100 100644 --- a/test-track/frontend/src/business/plan/view/comonents/report/detail/api/ApiBody.vue +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/api/ApiBody.vue @@ -270,8 +270,8 @@ export default { params.forEach(item => { if (item) { let line = []; - line[0] = item.substring(0, item.indexOf(":")); - line[1] = item.substring(item.indexOf(":") + 1, item.length); + line[0] = item.substring(0, item.indexOf(":")).trim(); + line[1] = item.substring(item.indexOf(":") + 1, item.length).trim(); let required = false; keyValues.push(new KeyValue({ name: line[0], diff --git a/workstation/frontend/src/business/module/environment/EnvironmentHttpConfig.vue b/workstation/frontend/src/business/module/environment/EnvironmentHttpConfig.vue index 567f6135ac..7712c95a83 100644 --- a/workstation/frontend/src/business/module/environment/EnvironmentHttpConfig.vue +++ b/workstation/frontend/src/business/module/environment/EnvironmentHttpConfig.vue @@ -453,12 +453,12 @@ export default { params.forEach(item => { if (item) { let line = item.split(/:|:/); - let values = item.split(line[0] + ":"); + let values = item.substr(line[0].length +1).trim(); let required = false; keyValues.push(new KeyValue({ name: line[0], required: required, - value: values[1], + value: values, type: "text", valid: false, file: false,