Compare commits
3 Commits
bd22a5aa41
...
43a81dd6ea
| Author | SHA1 | Date | |
|---|---|---|---|
| 43a81dd6ea | |||
| 87b80ed391 | |||
| f044361488 |
@ -32,12 +32,16 @@ func VerifySignature(paramsMap map[string]interface{}, receivedTimestamp, receiv
|
||||
// 验证时间戳是否超出 5 分钟-测试环境不验证
|
||||
if config.C.Env != "dev" {
|
||||
currentTime := time.Now().Unix() * 1000
|
||||
|
||||
timestamp, err := strconv.ParseInt(receivedTimestamp, 10, 64)
|
||||
fmt.Println(currentTime)
|
||||
fmt.Println(timestamp)
|
||||
|
||||
if err != nil {
|
||||
return errors.New("签名错误")
|
||||
}
|
||||
|
||||
if currentTime-timestamp > 300 {
|
||||
if currentTime-timestamp > 1500 {
|
||||
return errors.New("签名超时")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user