根据用户有无手机号返回tokentype

This commit is contained in:
苏尹岚
2020-02-19 18:25:25 +08:00
parent 9919f66072
commit 6719daaf05

View File

@@ -351,12 +351,12 @@ func RemoveUserInfo(token string) {
func GetTokenInfo(token string) (authInfo *AuthInfo, err error) {
if authInfo = getFixedTokenName(token); authInfo != nil {
if authInfo.Mobile == "" {
authInfo.TokenType = 2
}
return authInfo, nil
}
if err = api.Cacher.GetAs(token, &authInfo); err == nil {
if authInfo.Mobile == "" {
authInfo.TokenType = 2
}
return authInfo, nil
}
return nil, model.ErrTokenIsInvalid