fix: 修复普通用户无法校验cname配置的bug

pull/229/head
xiaojunnuo 2024-10-20 01:55:15 +08:00
parent 12116a89f4
commit 62854978bf
2 changed files with 11 additions and 8 deletions

View File

@ -74,6 +74,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
pipelineIds.push(record.id); pipelineIds.push(record.id);
recordMap[record.id] = record; recordMap[record.id] = record;
} }
if (pipelineIds?.length > 0) {
const vars = await this.storageService.findPipelineVars(pipelineIds); const vars = await this.storageService.findPipelineVars(pipelineIds);
for (const varEntity of vars) { for (const varEntity of vars) {
const record = recordMap[varEntity.namespace]; const record = recordMap[varEntity.namespace];
@ -82,6 +83,8 @@ export class PipelineService extends BaseService<PipelineEntity> {
record.lastVars = value.value; record.lastVars = value.value;
} }
} }
}
return result; return result;
} }

View File

@ -45,7 +45,7 @@ export class StorageService extends BaseService<StorageEntity> {
async findPipelineVars(pipelineIds: number[]) { async findPipelineVars(pipelineIds: number[]) {
if (pipelineIds == null || pipelineIds.length === 0) { if (pipelineIds == null || pipelineIds.length === 0) {
throw new Error('pipelineIds 不能为空'); return [];
} }
return await this.repository.find({ return await this.repository.find({
where: { where: {
@ -58,7 +58,7 @@ export class StorageService extends BaseService<StorageEntity> {
async getPipelinePrivateVars(pipelineId: number) { async getPipelinePrivateVars(pipelineId: number) {
if (pipelineId == null) { if (pipelineId == null) {
throw new Error('pipelineId 不能为空'); return [];
} }
const res = await this.repository.findOne({ const res = await this.repository.findOne({
where: { where: {