refactor(场景自动化): 优化场景跨项目环境选择

This commit is contained in:
fit2-zhao 2021-06-29 15:46:43 +08:00 committed by fit2-zhao
parent 24f3d36cc0
commit b6859e87ba
4 changed files with 10 additions and 14 deletions

View File

@ -605,7 +605,7 @@ public class ApiAutomationService {
}
}
if (http.isEnable()) {
if (http.getIsRefEnvironment()) {
if (StringUtils.isBlank(http.getUrl()) || (http.getIsRefEnvironment()!= null && http.getIsRefEnvironment())) {
env.getProjectIds().add(http.getProjectId());
env.setFullUrl(false);
}
@ -637,7 +637,7 @@ public class ApiAutomationService {
// 校验是否是全路径
MsHTTPSamplerProxy httpSamplerProxy = (MsHTTPSamplerProxy) tr;
if (httpSamplerProxy.isEnable()) {
if (httpSamplerProxy.getIsRefEnvironment()) {
if (StringUtils.isBlank(httpSamplerProxy.getUrl()) || (httpSamplerProxy.getIsRefEnvironment()!= null && httpSamplerProxy.getIsRefEnvironment())) {
env.getProjectIds().add(httpSamplerProxy.getProjectId());
env.setFullUrl(false);
}
@ -678,7 +678,7 @@ public class ApiAutomationService {
http.setUrl(apiDefinition.getPath());
}
if (http.isEnable()) {
if (http.getIsRefEnvironment()) {
if (StringUtils.isBlank(http.getUrl()) || (http.getIsRefEnvironment()!= null && http.getIsRefEnvironment())) {
env.setFullUrl(false);
env.getProjectIds().add(http.getProjectId());
}

View File

@ -110,7 +110,7 @@ export default {
map.set(dt.id, dt.selectEnv);
})
if (!sign) {
this.$warning("请为每个项目选择一个运行环境");
this.$warning("请为每个项目选择一个运行环境2");
return;
}
this.$emit('setProjectEnvMap', map);
@ -130,7 +130,7 @@ export default {
}
if (!sign) {
this.$warning("请为每个项目选择一个运行环境");
this.$warning("请为每个项目选择一个运行环境3");
return false;
}
return true;

View File

@ -275,6 +275,9 @@ export default {
checkEnv(data) {
let sign = true;
this.isFullUrl = true;
if(data){
return true;
}
if (this.data.length > 0) {
this.data.forEach(dt => {
if (!dt.selectEnv) {
@ -291,14 +294,7 @@ export default {
return false;
}
})
} else {
if (!data) {
sign = false;
}
}
//
//this.checkFullUrl(data);
//sign = this.isFullUrl;
}
if (!sign) {

View File

@ -127,7 +127,7 @@ export default {
map.set(dt.id, dt.selectEnv);
});
if (!sign) {
this.$warning("请为每个项目选择一个运行环境");
this.$warning("请为每个项目选择一个运行环境4");
return;
}
this.$emit('setProjectEnvMap', map);
@ -158,7 +158,7 @@ export default {
}
if (!sign) {
this.$warning("请为每个项目选择一个运行环境");
this.$warning("请为每个项目选择一个运行环境5");
return false;
}
return true;