添加日志
This commit is contained in:
parent
d48c8d4c16
commit
cfb1580054
@ -176,12 +176,12 @@ func (this *Agent) decodeUserData(msg *pb.UserMessage) (code pb.ErrorCode, err e
|
|||||||
this.gateway.Errorf("base64 decode err %v", err)
|
this.gateway.Errorf("base64 decode err %v", err)
|
||||||
return pb.ErrorCode_DecodeError, nil
|
return pb.ErrorCode_DecodeError, nil
|
||||||
}
|
}
|
||||||
now := time.Now().Unix()
|
now := configure.Now().Unix()
|
||||||
jsonRet := gjson.Parse(string(dec))
|
jsonRet := gjson.Parse(string(dec))
|
||||||
timestamp := jsonRet.Get("timestamp").Int()
|
timestamp := jsonRet.Get("timestamp").Int()
|
||||||
//秘钥30秒失效
|
//秘钥30秒失效
|
||||||
if now-time.Unix(timestamp, 0).Unix() > 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")
|
return pb.ErrorCode_TimestampTimeout, fmt.Errorf("sec key expire")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user