mirror of
https://github.com/certd/certd.git
synced 2026-04-28 07:57:25 +08:00
fix: 修复自定义插件onlyAdmin报错的bug
This commit is contained in:
@@ -165,7 +165,7 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
|||||||
this.registerSecret(cert.one);
|
this.registerSecret(cert.one);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.ctx.define.onlyAdmin) {
|
if (this.ctx?.define?.onlyAdmin) {
|
||||||
if (!this.isAdmin()) {
|
if (!this.isAdmin()) {
|
||||||
throw new Error("只有管理员才能运行此任务");
|
throw new Error("只有管理员才能运行此任务");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user