修复定时抢购前端显示“剩余 undefined 秒”问题

之前移除手动提前量时误删了 remainSecond 返回值,前端仍依赖该字段显示倒计时
This commit is contained in:
yml2213
2026-06-28 15:23:16 +08:00
parent d1b8fa0e46
commit b0862c55fc
+2
View File
@@ -5,6 +5,7 @@ import (
"bytes"
"errors"
"fmt"
"math"
"math/rand"
"os"
"path/filepath"
@@ -1193,6 +1194,7 @@ func (s *Scheduler) ScheduleRun(req types.SeckillRequest) (map[string]any, error
"success": true,
"targetTime": targetTime.In(constants.CST).Format("2006-01-02 15:04:05"),
"triggerTime": triggerTime.In(constants.CST).Format("2006-01-02 15:04:05"),
"remainSecond": int(math.Ceil(remain.Seconds())),
"offsetMs": calibration.Offset.Milliseconds(),
"errorBoundMs": calibration.ErrorBound.Milliseconds(),
"rttMs": calibration.RTT.Milliseconds(),