添加日志

This commit is contained in:
liwei1dao 2023-05-11 17:49:22 +08:00
parent d48c8d4c16
commit cfb1580054

View File

@ -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")
}