fix: api接口获取不到证书的bug

This commit is contained in:
xiaojunnuo
2025-07-18 14:46:58 +08:00
parent 747d266742
commit 05a33a0ec9
2 changed files with 33 additions and 5 deletions
@@ -86,7 +86,10 @@ export class CertInfoService extends BaseService<CertInfoEntity> {
async getMatchCertList(params: { domains: string[]; userId: number }) {
const { domains, userId } = params;
if (!domains) {
throw new CodeException(Constants.res.openCertNotFound);
throw new CodeException({
...Constants.res.openCertNotFound,
message:"域名不能为空"
});
}
const list = await this.find({
@@ -99,6 +102,9 @@ export class CertInfoService extends BaseService<CertInfoEntity> {
where: {
userId,
},
order: {
id: 'DESC',
},
});
//遍历查找
return list.filter(item => {
@@ -161,4 +167,12 @@ export class CertInfoService extends BaseService<CertInfoEntity> {
return bean;
}
async getByPipelineId(pipelineId: number) {
return await this.repository.findOne({
where: {
pipelineId,
},
});
}
}