fix: 修复自定义插件onlyAdmin报错的bug

v2-dev
xiaojunnuo 2025-07-22 23:31:42 +08:00
parent ab84835362
commit 4e5e862f58
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
this.registerSecret(cert.one);
}
if (this.ctx.define.onlyAdmin) {
if (this.ctx?.define?.onlyAdmin) {
if (!this.isAdmin()) {
throw new Error("只有管理员才能运行此任务");
}