fix(接口测试): 修复跨项目复制的自定义sql请求无法拿到原项目环境的缺陷

--bug=1025195 --user=王孝刚 【接口测试】场景中跨项目复制场景B(自定义sql请求),sql请求运行环境不能选原项目中的环境
https://www.tapd.cn/55049933/s/1360280
This commit is contained in:
wxg0103 2023-04-07 16:14:05 +08:00 committed by 刘瑞斌
parent bc5dc86247
commit afbe081d26
2 changed files with 8 additions and 1 deletions

View File

@ -273,6 +273,13 @@ export default {
this.request.projectId = getCurrentProjectID();
}
this.request.customizeReq = this.isCustomizeReq;
if (this.request.customizeReq) {
if (this.node.parent && this.node.parent.data && this.node.parent.data.length > 1) {
this.request.projectId = getCurrentProjectID();
}else {
this.request.projectId = this.node.parent.data.projectId;
}
}
if (this.currentScenario) {
this.request.currentScenarioId = this.currentScenario.id;
}

View File

@ -337,7 +337,7 @@ export default {
runTest() {},
itselfEnvironment(environmentId) {
let id = this.request.projectId ? this.request.projectId : this.projectId;
getEnvironmentByProjectId(this.projectId).then((response) => {
getEnvironmentByProjectId(id).then((response) => {
this.environments = response.data;
let targetDataSourceName = undefined;
let currentEnvironment = undefined;