From 7cecf01ed2b32da86219c430616f912103461071 Mon Sep 17 00:00:00 2001 From: icarus-ai <82353054+icarus-ai@users.noreply.github.com> Date: Wed, 15 Mar 2023 23:20:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20uptimes=20go=20time=20januay=3D1=20?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=BF=87=E4=B9=85=E5=8F=AF=E8=83=BD=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E4=B8=80=E4=B8=AA=E5=9B=BA=E5=AE=9A=E7=9A=84q16=20fde?= =?UTF-8?q?9508748b00283b2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/internal/auth/qimei.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/client/internal/auth/qimei.go b/client/internal/auth/qimei.go index 7685cb17..db5113e5 100644 --- a/client/internal/auth/qimei.go +++ b/client/internal/auth/qimei.go @@ -115,14 +115,7 @@ func genRandomPayloadByDevice(info *Device) map[string]any { seed += int64(b) } fixedRand := rand.New(rand.NewSource(seed)) - years := now.Year() - month := now.Month() - if month == 1 { - years-- - month = 12 - } else { - month-- - } + reserved := map[string]string{ "harmony": "0", "clone": "0", @@ -130,7 +123,7 @@ func genRandomPayloadByDevice(info *Device) map[string]any { "oz": "UhYmelwouA+V2nPWbOvLTgN2/m8jwGB+yUB5v9tysQg=", "oo": "Xecjt+9S1+f8Pz2VLSxgpw==", "kelong": "0", - "uptimes": time.Date(years, month, fixedRand.Intn(27)+1, fixedRand.Intn(60), fixedRand.Intn(60), fixedRand.Intn(60), fixedRand.Intn(1e9), now.Location()).Format("2006-01-02 15:04:05"), + "uptimes": time.Unix(now.Unix()-fixedRand.Int63n(86400), 0).Format(time.DateTime), "multiUser": "0", "bod": string(info.Board), "brd": string(info.Brand),