mirror of
https://github.com/certd/certd.git
synced 2026-04-16 05:50:50 +08:00
fix: 上传商用证书,直接粘贴文本报错的问题;修复无法上传ec加密证书的bug
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { Controller, Inject, Post, Provide, Query } from '@midwayjs/core';
|
||||
import {Body, Controller, Inject, Post, Provide, Query} from '@midwayjs/core';
|
||||
import { PipelineService } from '../../../modules/pipeline/service/pipeline-service.js';
|
||||
import { BaseController, Constants } from '@certd/lib-server';
|
||||
import { StorageService } from '../../../modules/pipeline/service/storage-service.js';
|
||||
import {CertReader} from "@certd/plugin-cert";
|
||||
|
||||
@Provide()
|
||||
@Controller('/api/pi/cert')
|
||||
@@ -18,4 +19,14 @@ export class CertController extends BaseController {
|
||||
const privateVars = await this.storeService.getPipelinePrivateVars(id);
|
||||
return this.ok(privateVars.cert);
|
||||
}
|
||||
|
||||
|
||||
@Post('/readCertDetail', { summary: Constants.per.authOnly })
|
||||
async readCertDetail(@Body('crt') crt: string) {
|
||||
if (!crt) {
|
||||
throw new Error('crt is required');
|
||||
}
|
||||
const certDetail = CertReader.readCertDetail(crt)
|
||||
return this.ok(certDetail);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user