修复定时抢购前端显示“剩余 undefined 秒”问题
之前移除手动提前量时误删了 remainSecond 返回值,前端仍依赖该字段显示倒计时
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@@ -1193,6 +1194,7 @@ func (s *Scheduler) ScheduleRun(req types.SeckillRequest) (map[string]any, error
|
|||||||
"success": true,
|
"success": true,
|
||||||
"targetTime": targetTime.In(constants.CST).Format("2006-01-02 15:04:05"),
|
"targetTime": targetTime.In(constants.CST).Format("2006-01-02 15:04:05"),
|
||||||
"triggerTime": triggerTime.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(),
|
"offsetMs": calibration.Offset.Milliseconds(),
|
||||||
"errorBoundMs": calibration.ErrorBound.Milliseconds(),
|
"errorBoundMs": calibration.ErrorBound.Milliseconds(),
|
||||||
"rttMs": calibration.RTT.Milliseconds(),
|
"rttMs": calibration.RTT.Milliseconds(),
|
||||||
|
|||||||
Reference in New Issue
Block a user