From 3b28d53d40b74f22079c656e28c7d3b11a3a3a83 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 14 Feb 2022 10:39:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8E=AF=E5=A2=83=E8=AE=BE=E7=BD=AE=E4=B8=AD?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=92=8C=E8=B7=AF=E5=BE=84=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E6=97=B6=E6=A8=A1=E5=9D=97=E5=92=8C=E8=B7=AF=E5=BE=84=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E4=B8=BA=E7=A9=BA=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=1010200 --user=王孝刚 【项目管理】github#9994,环境设置,建议模块和路径匹配时模块和路径不允许为空 https://www.tapd.cn/55049933/s/1103404 --- .../test/components/environment/EnvironmentHttpConfig.vue | 8 ++++++++ frontend/src/i18n/en-US.js | 4 +++- frontend/src/i18n/zh-CN.js | 4 +++- frontend/src/i18n/zh-TW.js | 4 +++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/api/test/components/environment/EnvironmentHttpConfig.vue b/frontend/src/business/components/api/test/components/environment/EnvironmentHttpConfig.vue index a299273077..67eb8aa48f 100644 --- a/frontend/src/business/components/api/test/components/environment/EnvironmentHttpConfig.vue +++ b/frontend/src/business/components/api/test/components/environment/EnvironmentHttpConfig.vue @@ -316,8 +316,16 @@ export default { domain: this.condition.domain, port: this.condition.port, time: new Date().getTime(), description: this.condition.description }; if (this.condition.type === "PATH") { + if (this.pathDetails.name === '') { + this.$warning(this.$t('api_test.environment.path_warning')); + return; + } obj.details = [JSON.parse(JSON.stringify(this.pathDetails))]; } else { + if (this.condition.details.length === 0) { + this.$warning(this.$t('api_test.environment.module_warning')); + return; + } obj.details = this.condition.details ? JSON.parse(JSON.stringify(this.condition.details)) : this.condition.details; } this.httpConfig.conditions.unshift(obj); diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 5eff777a39..d071a227bb 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -1389,7 +1389,9 @@ export default { request_timeout: "Request Timeout", response_timeout: "Response Timeout", repeat_warning: "The domain name whose activation condition is'None' already exists!", - copy_warning: "Domain names whose enabling conditions are'none' do not support copying!" + copy_warning: "Domain names whose enabling conditions are'none' do not support copying!", + path_warning: "The path cannot be empty", + module_warning: "The path cannot be empty" }, scenario: { id: "Scenario ID", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 45b7618c39..457af5b0ba 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -1394,7 +1394,9 @@ export default { request_timeout: "链接超时", response_timeout: "响应超时", repeat_warning: "启用条件为 '无' 的域名已经存在!", - copy_warning: "启用条件为 '无' 的域名不支持复制!" + copy_warning: "启用条件为 '无' 的域名不支持复制!", + path_warning: "路径不能为空", + module_warning: "模块不能为空" }, scenario: { id: "场景ID", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index c16da04a10..4d12cd3ad4 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -1394,7 +1394,9 @@ export default { request_timeout: "鏈接超時", response_timeout: "響應超時", repeat_warning: "啟用條件為 '無' 的域名已經存在!", - copy_warning: "啟用條件為 '無' 的域名不支持複製!" + copy_warning: "啟用條件為 '無' 的域名不支持複製!", + path_warning: "路徑不能為空", + module_warning: "模塊不能為空" }, scenario: { id: "場景ID",