mirror of https://github.com/certd/certd
chore:
parent
07043aff0c
commit
4caa2fad9d
|
@ -5,7 +5,7 @@ export type Registrable = {
|
|||
title: string;
|
||||
desc?: string;
|
||||
group?: string;
|
||||
deprecated?: string | boolean;
|
||||
deprecated?: string;
|
||||
};
|
||||
|
||||
export type RegistryItem<T> = {
|
||||
|
|
|
@ -246,18 +246,20 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
|||
let eab: EabAccess = null;
|
||||
|
||||
if (this.sslProvider === "google") {
|
||||
const eabAccessId = this.eabAccessId || this.googleCommonEabAccessId;
|
||||
if (this.googleAccessId) {
|
||||
this.logger.info("您正在使用google服务账号授权");
|
||||
this.logger.info("当前正在使用 google服务账号授权获取EAB");
|
||||
const googleAccess = await this.ctx.accessService.getById(this.googleAccessId);
|
||||
const googleClient = new GoogleClient({
|
||||
access: googleAccess,
|
||||
logger: this.logger,
|
||||
});
|
||||
eab = await googleClient.getEab();
|
||||
} else if (eabAccessId) {
|
||||
this.logger.info("您正在使用google EAB授权");
|
||||
eab = await this.ctx.accessService.getById(eabAccessId);
|
||||
} else if (this.eabAccessId) {
|
||||
this.logger.info("当前正在使用 google EAB授权");
|
||||
eab = await this.ctx.accessService.getById(this.eabAccessId);
|
||||
} else if (this.googleCommonEabAccessId) {
|
||||
this.logger.info("当前正在使用 google公共EAB授权");
|
||||
eab = await this.ctx.accessService.getById(this.googleCommonEabAccessId);
|
||||
} else {
|
||||
this.logger.error("google需要配置EAB授权或服务账号授权");
|
||||
return;
|
||||
|
|
|
@ -62,7 +62,7 @@ export class CnameRecordService extends BaseService<CnameRecordEntity> {
|
|||
//获取默认的cnameProviderId
|
||||
cnameProvider = await this.cnameProviderService.getByPriority();
|
||||
if (cnameProvider == null) {
|
||||
throw new ValidateException('找不到CNAME服务,请先联系管理员添加CNAME服务');
|
||||
throw new ValidateException('找不到CNAME服务,请先前往“系统管理->CNAME服务设置”添加CNAME服务');
|
||||
}
|
||||
} else {
|
||||
cnameProvider = await this.cnameProviderService.info(param.cnameProviderId);
|
||||
|
|
|
@ -67,6 +67,14 @@ export class PluginConfigService {
|
|||
async getPluginConfig(req: PluginFindReq) {
|
||||
const plugin = await this.get(req);
|
||||
let sysSetting: any = {};
|
||||
if (!plugin) {
|
||||
return {
|
||||
name: req.name,
|
||||
disabled: false,
|
||||
type: req.type,
|
||||
sysSetting,
|
||||
};
|
||||
}
|
||||
if (plugin && plugin.sysSetting) {
|
||||
sysSetting = JSON.parse(plugin.sysSetting);
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ export class PluginService extends BaseService<PluginEntity> {
|
|||
return records;
|
||||
}
|
||||
|
||||
async setDisabled(opts: { id: number; name: string; type: string; disabled: boolean }) {
|
||||
async setDisabled(opts: { id?: number; name?: string; type: string; disabled: boolean }) {
|
||||
const { id, name, type, disabled } = opts;
|
||||
if (!type) {
|
||||
throw new Error('参数错误: type 不能为空');
|
||||
|
|
Loading…
Reference in New Issue