fix(接口定义): 修复sql接口和用例,保存的环境被删除后,运行环境显示了ID的缺陷
--bug=1023102 --user=王孝刚 【接口测试】sql接口和用例,保存的环境被删除后,运行环境显示了ID https://www.tapd.cn/55049933/s/1336062
This commit is contained in:
parent
77f97c940a
commit
01ccfde3e6
|
@ -341,6 +341,7 @@ export default {
|
||||||
this.environments = response.data;
|
this.environments = response.data;
|
||||||
let targetDataSourceName = undefined;
|
let targetDataSourceName = undefined;
|
||||||
let currentEnvironment = undefined;
|
let currentEnvironment = undefined;
|
||||||
|
let hasEnvironment = false;
|
||||||
this.environments.forEach((environment) => {
|
this.environments.forEach((environment) => {
|
||||||
parseEnvironment(environment);
|
parseEnvironment(environment);
|
||||||
// 找到原始环境和数据源名称
|
// 找到原始环境和数据源名称
|
||||||
|
@ -348,6 +349,7 @@ export default {
|
||||||
currentEnvironment = environment;
|
currentEnvironment = environment;
|
||||||
}
|
}
|
||||||
if (environment.id === this.request.environmentId) {
|
if (environment.id === this.request.environmentId) {
|
||||||
|
hasEnvironment = true;
|
||||||
if (environment.config && environment.config.databaseConfigs) {
|
if (environment.config && environment.config.databaseConfigs) {
|
||||||
environment.config.databaseConfigs.forEach((item) => {
|
environment.config.databaseConfigs.forEach((item) => {
|
||||||
if (item.id === this.request.dataSourceId) {
|
if (item.id === this.request.dataSourceId) {
|
||||||
|
@ -357,6 +359,21 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (!hasEnvironment) {
|
||||||
|
this.request.environmentId = store.useEnvironment;
|
||||||
|
this.environments.forEach((environment) => {
|
||||||
|
if (environment.id === store.useEnvironment) {
|
||||||
|
currentEnvironment = environment;
|
||||||
|
}
|
||||||
|
if (environment.config && environment.config.databaseConfigs) {
|
||||||
|
environment.config.databaseConfigs.forEach((item) => {
|
||||||
|
if (item.id === this.request.dataSourceId) {
|
||||||
|
targetDataSourceName = item.name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
this.initDataSource(environmentId, currentEnvironment, targetDataSourceName);
|
this.initDataSource(environmentId, currentEnvironment, targetDataSourceName);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue