From 032ecdd444c5fa53a9c76fdda5aa47ff812ee9f8 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 23 Mar 2023 13:52:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dwindows=E5=92=8Clinux=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E7=AC=A6=E5=88=87=E5=89=B2=E7=9A=84=E7=BC=BA?= =?UTF-8?q?=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1024736 --user=王孝刚 [接口测试]github#22450接口请求体form-data批量添加后字段存在换行导致接口无法正常测试 https://www.tapd.cn/55049933/s/1354971 --- .../src/business/automation/scenario/variable/VariableList.vue | 2 +- .../src/business/definition/components/body/ApiBody.vue | 2 +- .../definition/components/request/http/ApiHttpRequestForm.vue | 2 +- .../src/components/environment/EnvironmentHttpConfig.vue | 2 +- .../src/components/environment/commons/ApiScenarioVariables.vue | 2 +- .../menu/environment/components/EnvironmentHttpConfig.vue | 2 +- 6 files changed, 6 insertions(+), 6 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 686f340435..d18e665ec2 100644 --- a/api-test/frontend/src/business/automation/scenario/variable/VariableList.vue +++ b/api-test/frontend/src/business/automation/scenario/variable/VariableList.vue @@ -331,7 +331,7 @@ export default { }, _handleBatchVars(data) { if (data) { - let params = data.split('\n'); + let params = data.split(/[(\r\n)\r\n]+/); let keyValues = []; params.forEach((item) => { if (item) { 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 41d19b1d84..65d041e16c 100644 --- a/api-test/frontend/src/business/definition/components/body/ApiBody.vue +++ b/api-test/frontend/src/business/definition/components/body/ApiBody.vue @@ -350,7 +350,7 @@ export default { }, batchSave(data) { if (data) { - let params = data.split('\n'); + let params = data.split(/[(\r\n)\r\n]+/); let keyValues = []; params.forEach((item) => { if (item) { 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 991aa5cf09..ac17b9f842 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 @@ -507,7 +507,7 @@ export default { }, batchSave(data) { if (data) { - let params = data.split('\n'); + let params = data.split(/[(\r\n)\r\n]+/); let keyValues = []; params.forEach((item) => { if (item) { diff --git a/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue b/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue index 9eacb1cc20..e9ccc64dd5 100644 --- a/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue +++ b/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue @@ -469,7 +469,7 @@ export default { this.$refs.batchAdd.open(); }, _handleBatchVars(data) { - let params = data.split("\n"); + let params = data.split(/[(\r\n)\r\n]+/); let keyValues = []; params.forEach(item => { if (item) { 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 89be3701ca..be149c4644 100644 --- a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue +++ b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue @@ -431,7 +431,7 @@ export default { return this.items.length - 1 !== index; }, _handleBatchVars(data) { - let params = data.split('\n'); + let params = data.split(/[(\r\n)\r\n]+/); let keyValues = []; params.forEach((item) => { if (item) { 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 e9acda6b19..5ed0f26c86 100644 --- a/project-management/frontend/src/business/menu/environment/components/EnvironmentHttpConfig.vue +++ b/project-management/frontend/src/business/menu/environment/components/EnvironmentHttpConfig.vue @@ -477,7 +477,7 @@ export default { this.$refs.batchAdd.open(); }, _handleBatchVars(data) { - let params = data.split("\n"); + let params = data.split(/[(\r\n)\r\n]+/); let keyValues = []; params.forEach(item => { if (item) {