Skip to content

Commit

Permalink
fix: uptimes
Browse files Browse the repository at this point in the history
go time januay=1
时间过久可能返回一个固定的q16 fde9508748b00283b2
  • Loading branch information
icarus-ai committed Mar 15, 2023
1 parent 5e7ade1 commit 7cecf01
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions client/internal/auth/qimei.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,15 @@ 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",
"containe": "",
"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),
Expand Down

0 comments on commit 7cecf01

Please sign in to comment.