mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
fix: 修复普通用户无法校验cname配置的bug
This commit is contained in:
@@ -74,14 +74,17 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
pipelineIds.push(record.id);
|
||||
recordMap[record.id] = record;
|
||||
}
|
||||
const vars = await this.storageService.findPipelineVars(pipelineIds);
|
||||
for (const varEntity of vars) {
|
||||
const record = recordMap[varEntity.namespace];
|
||||
if (record) {
|
||||
const value = JSON.parse(varEntity.value);
|
||||
record.lastVars = value.value;
|
||||
if (pipelineIds?.length > 0) {
|
||||
const vars = await this.storageService.findPipelineVars(pipelineIds);
|
||||
for (const varEntity of vars) {
|
||||
const record = recordMap[varEntity.namespace];
|
||||
if (record) {
|
||||
const value = JSON.parse(varEntity.value);
|
||||
record.lastVars = value.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export class StorageService extends BaseService<StorageEntity> {
|
||||
|
||||
async findPipelineVars(pipelineIds: number[]) {
|
||||
if (pipelineIds == null || pipelineIds.length === 0) {
|
||||
throw new Error('pipelineIds 不能为空');
|
||||
return [];
|
||||
}
|
||||
return await this.repository.find({
|
||||
where: {
|
||||
@@ -58,7 +58,7 @@ export class StorageService extends BaseService<StorageEntity> {
|
||||
|
||||
async getPipelinePrivateVars(pipelineId: number) {
|
||||
if (pipelineId == null) {
|
||||
throw new Error('pipelineId 不能为空');
|
||||
return [];
|
||||
}
|
||||
const res = await this.repository.findOne({
|
||||
where: {
|
||||
|
||||
Reference in New Issue
Block a user