fix(接口测试): 修复引用JDBC步骤报错问题

This commit is contained in:
fit2-zhao 2022-03-23 17:54:04 +08:00 committed by 刘瑞斌
parent 342b0455ce
commit 34c15e4ef0
1 changed files with 13 additions and 4 deletions

View File

@ -169,14 +169,23 @@ export default {
});
let hasEnvironment = false;
for (let i in this.environments) {
if (this.environments[i].id === this.request.environmentId &&
this.$store.state.scenarioEnvMap.get(this.projectId) === this.request.environmentId) {
hasEnvironment = true;
if (this.environments[i].id === this.request.environmentId) {
if (this.$store.state.scenarioEnvMap && this.$store.state.scenarioEnvMap instanceof Map) {
if (this.$store.state.scenarioEnvMap.has(this.projectId) &&
this.$store.state.scenarioEnvMap.get(this.projectId) === this.request.environmentId) {
hasEnvironment = true;
}
} else {
hasEnvironment = true;
}
break;
}
}
if (!hasEnvironment) {
this.request.environmentId = this.$store.state.scenarioEnvMap.get(this.projectId);
if (this.$store.state.scenarioEnvMap && this.$store.state.scenarioEnvMap instanceof Map
&& this.$store.state.scenarioEnvMap.has(this.projectId)) {
this.request.environmentId = this.$store.state.scenarioEnvMap.get(this.projectId);
}
}
if (!this.request.environmentId) {
this.request.dataSourceId = undefined;