refactor: 场景默认加载当前项目的环境配置

This commit is contained in:
chenjianxing 2021-05-19 10:51:58 +08:00 committed by BugKing
parent 1b3954fec7
commit 497331f73a
2 changed files with 7 additions and 0 deletions

View File

@ -1019,6 +1019,7 @@
this.$post("/api/automation/getApiScenarioEnv", {definition: definition}, res => {
if (res.data) {
this.projectIds = new Set(res.data.projectIds);
this.projectIds.add(this.projectId);
this.isFullUrl = res.data.fullUrl;
}
resolve();

View File

@ -54,6 +54,11 @@
}
}
},
computed: {
projectId() {
return this.$store.state.projectId
}
},
mounted() {
this.envMap = this.projectEnvMap;
this.getVariableSize();
@ -124,6 +129,7 @@
return new Promise((resolve) => {
this.$post("/api/automation/getApiScenarioEnv", {definition: definition}, res => {
if (res.data) {
res.data.projectIds.push(this.projectId);
this.$emit("update:projectIds", new Set(res.data.projectIds));
this.$emit("update:isFullUrl", res.data.fullUrl);
}