From f439433cc7b3cdc5917939c9692d3315ebbf0061 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 9 May 2022 16:50:54 +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=8D=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E8=B7=AF=E5=BE=84=E5=8C=85=E5=90=AB=E7=A9=BA=E6=A0=BC?= =?UTF-8?q?=EF=BC=8C=E6=8F=90=E7=A4=BA=E8=B7=AF=E5=BE=84=E6=97=A0=E6=95=88?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1012800 --user=赵勇 [接口定义]github#13036接口定义,请求路径包含空格,提示路径无效 https://www.tapd.cn/55049933/s/1154831 --- .../components/api/automation/scenario/api/AddBasisApi.vue | 4 ++-- .../api/definition/components/basis/AddBasisApi.vue | 4 ++-- .../definition/components/complete/EditCompleteHTTPApi.vue | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/api/AddBasisApi.vue b/frontend/src/business/components/api/automation/scenario/api/AddBasisApi.vue index dd63a237ca..25586cc23d 100644 --- a/frontend/src/business/components/api/automation/scenario/api/AddBasisApi.vue +++ b/frontend/src/business/components/api/automation/scenario/api/AddBasisApi.vue @@ -78,7 +78,7 @@ }, data() { let validateURL = (rule, value, callback) => { - if (!this.httpForm.path.startsWith("/") || this.httpForm.path.match(/\s/) != null) { + if (!this.httpForm.path.startsWith("/")) { callback(this.$t('api_test.definition.request.path_valid_info')); } callback(); @@ -112,7 +112,7 @@ saveApi() { this.$refs['httpForm'].validate((valid) => { if (valid) { - if (this.httpForm.path && this.httpForm.path.match(/\s/) != null) { + if (this.httpForm.path) { this.$error(this.$t("api_test.definition.request.path_valid_info")); return false; } diff --git a/frontend/src/business/components/api/definition/components/basis/AddBasisApi.vue b/frontend/src/business/components/api/definition/components/basis/AddBasisApi.vue index 57585fd94a..010d3faef8 100644 --- a/frontend/src/business/components/api/definition/components/basis/AddBasisApi.vue +++ b/frontend/src/business/components/api/definition/components/basis/AddBasisApi.vue @@ -74,7 +74,7 @@ }, data() { let validateURL = (rule, value, callback) => { - if (!this.httpForm.path.startsWith("/") || this.httpForm.path.match(/\s/) != null) { + if (!this.httpForm.path.startsWith("/")) { callback(this.$t('api_test.definition.request.path_valid_info')); } callback(); @@ -120,7 +120,7 @@ saveApi(saveAs) { this.$refs['httpForm'].validate((valid) => { if (valid) { - if (this.httpForm.path && this.httpForm.path.match(/\s/) != null) { + if (this.httpForm.path) { this.$error(this.$t("api_test.definition.request.path_valid_info")); return false; } 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 81060268e3..92821419ec 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue @@ -220,7 +220,7 @@ export default { }, data() { let validateURL = (rule, value, callback) => { - if (!this.httpForm.path.startsWith("/") || this.httpForm.path.match(/\s/) != null) { + if (!this.httpForm.path.startsWith("/")) { callback(this.$t('api_test.definition.request.path_valid_info')); } callback(); @@ -497,7 +497,7 @@ export default { }, getURL(urlStr) { try { - let url = new URL(urlStr); + let url = urlStr; if (url.search && url.search.length > 1) { let params = url.search.substr(1).split("&"); params.forEach(param => {