perf: 支持手动上传证书并部署

This commit is contained in:
xiaojunnuo
2025-03-17 00:19:01 +08:00
parent 0069c0e399
commit a9fffa5180
14 changed files with 245 additions and 90 deletions

View File

@@ -24,11 +24,17 @@ export class CertInfoController extends CrudController<CertInfoService> {
async page(@Body(ALL) body: any) {
body.query = body.query ?? {};
body.query.userId = this.getUserId();
const domains = body.query?.domains;
delete body.query.domains;
const res = await this.service.page({
query: body.query,
page: body.page,
sort: body.sort,
buildQuery: (bq) => {
if (domains) {
bq.andWhere('domains like :domains', { domains: `%${domains}%` });
}
}
});
const records = res.records;
@@ -88,7 +94,11 @@ export class CertInfoController extends CrudController<CertInfoService> {
@Post('/upload', { summary: Constants.per.authOnly })
async upload(@Body(ALL) body: any) {
if (body.id) {
//修改
await this.service.checkUserId(body.id, this.getUserId());
}else{
//添加
body.userId = this.getUserId();
}
const res = await this.service.upload(body);