|
|
|
@ -218,13 +218,13 @@ func VerifyToken(token, uid string) (bool, error) {
|
|
|
|
|
func WsVerifyToken(token, uid string, platformID string) (bool, error, string) {
|
|
|
|
|
claims, err := ParseToken(token, "")
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, utils.Wrap(err, ""), "parse token err"
|
|
|
|
|
return false, utils.Wrap(err, "parse token err"), "parse token err"
|
|
|
|
|
}
|
|
|
|
|
if claims.UID != uid {
|
|
|
|
|
return false, utils.Wrap(&constant.ErrTokenUnknown, ""), "uid is not same to token uid"
|
|
|
|
|
return false, utils.Wrap(&constant.ErrTokenUnknown, "uid is not same to token uid"), "uid is not same to token uid"
|
|
|
|
|
}
|
|
|
|
|
if claims.Platform != constant.PlatformIDToName(utils.StringToInt32(platformID)) {
|
|
|
|
|
return false, utils.Wrap(&constant.ErrTokenUnknown, ""), "platform is not same to token platform"
|
|
|
|
|
return false, utils.Wrap(&constant.ErrTokenUnknown, "platform is not same to token platform"), "platform is not same to token platform"
|
|
|
|
|
}
|
|
|
|
|
log.NewDebug("", claims.UID, claims.Platform)
|
|
|
|
|
return true, nil, ""
|
|
|
|
|