refactor(场景自动化): 优化场景跨项目环境选择
This commit is contained in:
parent
0f535cb72e
commit
0944eef6b4
|
@ -601,7 +601,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);
|
||||
}
|
||||
|
@ -633,7 +633,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);
|
||||
}
|
||||
|
@ -674,7 +674,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());
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue