From cfb15800545230d1bc8e1fb5d76ca6d8d7aa8c8f Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 11 May 2023 17:49:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gateway/agent.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index d9e8ba4c6..22cb614ab 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -176,12 +176,12 @@ func (this *Agent) decodeUserData(msg *pb.UserMessage) (code pb.ErrorCode, err e this.gateway.Errorf("base64 decode err %v", err) return pb.ErrorCode_DecodeError, nil } - now := time.Now().Unix() + now := configure.Now().Unix() jsonRet := gjson.Parse(string(dec)) timestamp := jsonRet.Get("timestamp").Int() //秘钥30秒失效 if now-time.Unix(timestamp, 0).Unix() > 30 { - this.gateway.Errorf("last timestamp:%v more than 30s", timestamp) + this.gateway.Errorf("now:%v last timestamp:%v more than 30s", now, timestamp) return pb.ErrorCode_TimestampTimeout, fmt.Errorf("sec key expire") }