From 4f542b3d4700a4f0699aa9ccf5e145e42cf67018 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 22 Dec 2023 16:49:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20ht?= =?UTF-8?q?tp=E8=AF=B7=E6=B1=82=E5=8E=BB=E9=99=A4=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/business/definition/components/ApiConfig.vue | 3 --- .../definition/components/complete/EditCompleteHTTPApi.vue | 5 ++++- .../definition/components/runtest/RunTestHTTPPage.vue | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/api-test/frontend/src/business/definition/components/ApiConfig.vue b/api-test/frontend/src/business/definition/components/ApiConfig.vue index cd224a04d3..dd02b6fe27 100644 --- a/api-test/frontend/src/business/definition/components/ApiConfig.vue +++ b/api-test/frontend/src/business/definition/components/ApiConfig.vue @@ -334,8 +334,6 @@ export default { this.sort(this.request.hashTree); }, setParameter(data) { - // 去除Path结尾空格 - data.path = data.path.trimEnd(); data.name = this.currentApi.name; data.moduleId = this.currentApi.moduleId; data.modulePath = this.currentApi.modulePath; @@ -433,7 +431,6 @@ export default { setParameters(data) { data.projectId = this.projectId; this.request.name = this.currentApi.name; - this.request.path = data.path.trimEnd(); data.protocol = this.currentProtocol; data.request = this.request; data.request.name = data.name; diff --git a/api-test/frontend/src/business/definition/components/complete/EditCompleteHTTPApi.vue b/api-test/frontend/src/business/definition/components/complete/EditCompleteHTTPApi.vue index 7afdac5210..59acaf286e 100644 --- a/api-test/frontend/src/business/definition/components/complete/EditCompleteHTTPApi.vue +++ b/api-test/frontend/src/business/definition/components/complete/EditCompleteHTTPApi.vue @@ -463,7 +463,7 @@ export default { }); }, setParameter() { - this.request.path = this.httpForm.path; + this.request.path = this.httpForm.path.trimEnd(); this.request.method = this.httpForm.method; if (this.httpForm && this.httpForm.request) { this.httpForm.request.useEnvironment = undefined; @@ -783,6 +783,9 @@ export default { if (url) { this.httpForm.path = decodeURIComponent(this.httpForm.path.substr(0, this.httpForm.path.indexOf('?'))); } + if (this.httpForm.path) { + this.httpForm.path = this.httpForm.path.trimEnd(); + } }, addProtocol(url) { if (url) { diff --git a/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue b/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue index 4587ac4081..0e0f4b8430 100644 --- a/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue +++ b/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue @@ -23,6 +23,7 @@ v-model="api.request.path" class="ms-htt-width" size="small" + @change="trimPath" :disabled="false" /> @@ -872,6 +873,11 @@ export default { } } }, + trimPath() { + if (this.api.request.path) { + this.api.request.path = this.api.request.path.trimEnd(); + } + } }, created() {