chore: project fix

This commit is contained in:
xiaojunnuo
2026-03-04 23:53:19 +08:00
parent 17dd77cc96
commit 5ee3874b7e
14 changed files with 48 additions and 48 deletions

View File

@@ -170,9 +170,7 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
}
if (this.ctx?.define?.onlyAdmin) {
if (!this.isAdmin()) {
throw new Error("只有管理员才能运行此任务");
}
this.checkAdmin();
}
}
@@ -284,6 +282,12 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
return this.ctx.user.role === "admin";
}
checkAdmin() {
if (!this.isAdmin()) {
throw new Error("只有“管理员”或“系统级项目”才有权限运行此插件任务");
}
}
getStepFromPipeline(stepId: string) {
let found: any = null;
RunnableCollection.each(this.ctx.pipeline.stages, step => {