fix(项目管理): 修改环境设置中模块和路径匹配时模块和路径可以为空的缺陷

--bug=1010200 --user=王孝刚 【项目管理】github#9994,环境设置,建议模块和路径匹配时模块和路径不允许为空
https://www.tapd.cn/55049933/s/1103404
This commit is contained in:
wxg0103 2022-02-14 10:39:39 +08:00 committed by 刘瑞斌
parent 0f0af3ba27
commit 3b28d53d40
4 changed files with 17 additions and 3 deletions

View File

@ -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);

View File

@ -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",

View File

@ -1394,7 +1394,9 @@ export default {
request_timeout: "链接超时",
response_timeout: "响应超时",
repeat_warning: "启用条件为 '无' 的域名已经存在!",
copy_warning: "启用条件为 '无' 的域名不支持复制!"
copy_warning: "启用条件为 '无' 的域名不支持复制!",
path_warning: "路径不能为空",
module_warning: "模块不能为空"
},
scenario: {
id: "场景ID",

View File

@ -1394,7 +1394,9 @@ export default {
request_timeout: "鏈接超時",
response_timeout: "響應超時",
repeat_warning: "啟用條件為 '無' 的域名已經存在!",
copy_warning: "啟用條件為 '無' 的域名不支持複製!"
copy_warning: "啟用條件為 '無' 的域名不支持複製!",
path_warning: "路徑不能為空",
module_warning: "模塊不能為空"
},
scenario: {
id: "場景ID",