fix(接口测试): 未保存数据源切换丢失问题修复
--bug=1021914 --user=赵勇 【接口测试】场景中的http请求添加的前后置sql手动修改数据源不生效 https://www.tapd.cn/55049933/s/1326880
This commit is contained in:
parent
26c12aade1
commit
b407b09a21
|
@ -147,7 +147,7 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
this.getEnvironments();
|
||||
this.getEnvironments(null, 'created');
|
||||
},
|
||||
computed: {
|
||||
projectId() {
|
||||
|
@ -235,7 +235,7 @@ export default {
|
|||
this.initDataSource(undefined, undefined, targetDataSourceName);
|
||||
});
|
||||
},
|
||||
getEnvironments(environmentId) {
|
||||
getEnvironments(environmentId, isCreated) {
|
||||
let envId = '';
|
||||
let id = this.request.projectId ? this.request.projectId : this.projectId;
|
||||
let scenarioEnvId = this.scenarioId !== '' ? this.scenarioId + '_' + id : id;
|
||||
|
@ -262,7 +262,11 @@ export default {
|
|||
envId = this.request.refEevMap.get(id);
|
||||
}
|
||||
}
|
||||
if (envId === this.request.originalEnvironmentId && this.request.originalDataSourceId) {
|
||||
if (
|
||||
envId === this.request.originalEnvironmentId &&
|
||||
this.request.originalDataSourceId &&
|
||||
isCreated !== 'created'
|
||||
) {
|
||||
this.request.dataSourceId = this.request.originalDataSourceId;
|
||||
}
|
||||
let targetDataSourceName = '';
|
||||
|
|
Loading…
Reference in New Issue