diff --git a/src/model/ApiClient.ts b/src/model/ApiClient.ts index a9fb81b..aee3aba 100644 --- a/src/model/ApiClient.ts +++ b/src/model/ApiClient.ts @@ -170,6 +170,10 @@ export class ApiClient { return this.request('POST', '/api/expedition/check'); } + async expeditionAutoCheck(allowRepair = true): Promise { + return this.request('POST', '/api/expedition/auto_check', { allow_repair: allowRepair }); + } + // ── 游戏状态查询 ── async gameContext(): Promise> { diff --git a/src/model/scheduler/Scheduler.ts b/src/model/scheduler/Scheduler.ts index b4652ed..923d7f5 100644 --- a/src/model/scheduler/Scheduler.ts +++ b/src/model/scheduler/Scheduler.ts @@ -289,14 +289,16 @@ export class Scheduler { Logger.debug(`consumeNext: 「${task.name}」 type=${task.type} remaining=${task.remainingTimes}/${task.totalTimes} req=${JSON.stringify(task.request)}`, 'scheduler'); - // 远征任务: 直接调用远征 API,不走 taskStart 流程 + // 远征任务: 调用挂机专用自动检查端点,不走 taskStart 流程 + // 若队列里还有后续任务,则禁止自动维修,避免任务间隙占用舰队 if (task.type === 'expedition') { + const allowRepair = this._taskQueue.length === 0; try { - this.emitLog('info', '正在检查远征...'); - await this.api.expeditionCheck(); - this.emitLog('info', '远征检查完成'); + this.emitLog('info', '正在执行自动远征检查...'); + await this.api.expeditionAutoCheck(allowRepair); + this.emitLog('info', '自动远征检查完成'); } catch { - this.emitLog('debug', '远征检查跳过'); + this.emitLog('debug', '自动远征检查跳过'); } this.currentTask = null; this.consumeNext();