Skip to content

Commit

Permalink
update print err
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangb committed Aug 24, 2021
1 parent d41dc62 commit 3012ee7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gtoken/gtoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ func (m *GfToken) EncryptToken(userKey string, uuid string) Resp {

token, err := gaes.Encrypt([]byte(tokenStr), m.EncryptKey)
if err != nil {
glog.Error("[GToken]encrypt error", err)
glog.Error("[GToken]encrypt error token:", tokenStr, err)
return Error("encrypt error")
}

Expand All @@ -534,17 +534,17 @@ func (m *GfToken) DecryptToken(token string) Resp {

token64, err := gbase64.Decode([]byte(token))
if err != nil {
glog.Error("[GToken]decode error", err)
glog.Error("[GToken]decode error token:", token, err)
return Error("decode error")
}
decryptToken, err2 := gaes.Decrypt(token64, m.EncryptKey)
if err2 != nil {
glog.Error("[GToken]decrypt error", err2)
glog.Error("[GToken]decrypt error token:", token, err2)
return Error("decrypt error")
}
tokenArray := gstr.Split(string(decryptToken), m.TokenDelimiter)
if len(tokenArray) < 2 {
glog.Error("[GToken]token len error")
glog.Error("[GToken]token len error token:", token)
return Error("token len error")
}

Expand Down

0 comments on commit 3012ee7

Please sign in to comment.