@@ -6,6 +6,7 @@ import (
"encoding/hex"
"errors"
"fmt"
+ "math"
"mtp2_if/config"
"mtp2_if/global/e"
"mtp2_if/rediscli"
@@ -131,7 +132,7 @@ func Auth() gin.HandlerFunc {
c.Abort()
return
}
- if time.Now().UnixMilli()-int64(t) > 10*1000 {
+ if math.Abs(float64(time.Now().UnixMilli()-int64(t))) > 10*1000 {
c.JSON(http.StatusUnauthorized, gin.H{
"code": e.ERROR,
"msg": "apikey3",