mirror of
https://github.com/certd/certd.git
synced 2026-05-16 05:07:32 +08:00
fix: api接口获取不到证书的bug
This commit is contained in:
@@ -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,
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user