|
@@ -19,7 +19,7 @@ class SigcertController extends Controller {
|
|
|
const resreq = await this.service.shell.applyreq({ ...ctx.request.body, keyPath: `${filePath.keys}${uuid}.key`, filePath: `${filePath.req}${uuid}.pem` });
|
|
|
if (resreq.errcode === 0) {
|
|
|
const form = { state, dn, pwatype, name, uuid };
|
|
|
- const person = this.app.readConfig(filePath.configJson);
|
|
|
+ const person = await this.app.readConfig(filePath.configJson);
|
|
|
person.cert.push(form);
|
|
|
const jsonstr = JSON.stringify(person);
|
|
|
// 添加到数据文件
|
|
@@ -35,7 +35,7 @@ class SigcertController extends Controller {
|
|
|
// 签名证书查询
|
|
|
async sigcacertquery() {
|
|
|
const { ctx } = this;
|
|
|
- const person = this.app.readConfig(filePath.configJson);
|
|
|
+ const person = await this.app.readConfig(filePath.configJson);
|
|
|
const data = person.cert;
|
|
|
const total = data.length || 0;
|
|
|
ctx.body = { errcode: 0, errmsg: '', data, total };
|
|
@@ -43,7 +43,7 @@ class SigcertController extends Controller {
|
|
|
// 删除签名证书
|
|
|
async sigcertdelete() {
|
|
|
const uuid = this.ctx.query.uuid;
|
|
|
- const configJson = this.app.readConfig(filePath.configJson);
|
|
|
+ const configJson = await this.app.readConfig(filePath.configJson);
|
|
|
// 过滤掉当前uuid数据
|
|
|
const data = configJson.cert.filter(p => p.uuid !== uuid);
|
|
|
const isdata = configJson.cert.filter(p => p.uuid === uuid);
|
|
@@ -75,7 +75,7 @@ class SigcertController extends Controller {
|
|
|
// 签名证书上传
|
|
|
async sigcacertupload() {
|
|
|
const { ctx } = this;
|
|
|
- const person = this.app.readConfig(filePath.configJson);
|
|
|
+ const person = await this.app.readConfig(filePath.configJson);
|
|
|
const stream = await this.ctx.getFileStream();
|
|
|
const uuid = stream.fields.uuid;
|
|
|
// 路径 + 文件名
|