diff --git a/backend/services/admin-service/src/api/controllers/system-maintenance.controller.ts b/backend/services/admin-service/src/api/controllers/system-maintenance.controller.ts index 211b4100..f4a1094d 100644 --- a/backend/services/admin-service/src/api/controllers/system-maintenance.controller.ts +++ b/backend/services/admin-service/src/api/controllers/system-maintenance.controller.ts @@ -176,14 +176,24 @@ export class AdminMaintenanceController { const active = await this.maintenanceRepo.findActiveMaintenance(); if (!active) { - return { inMaintenance: false }; + return { isUnderMaintenance: false, maintenance: null }; } + // 计算剩余分钟数 + const now = new Date(); + const endTime = new Date(active.endTime); + const remainingMs = endTime.getTime() - now.getTime(); + const remainingMinutes = Math.max(0, Math.ceil(remainingMs / 60000)); + return { - inMaintenance: true, - title: active.title, - message: active.message, - endTime: active.endTime, + isUnderMaintenance: true, + maintenance: { + title: active.title, + message: active.message, + startTime: active.startTime, + endTime: active.endTime, + remainingMinutes, + }, }; } }