RegisterUser支持注册用户时,不指定手机号

This commit is contained in:
gazebo
2019-10-21 15:14:34 +08:00
parent d24b8ea53d
commit bed2d85833
4 changed files with 49 additions and 26 deletions

View File

@@ -145,3 +145,14 @@ func (ctx *Context) GetMobileAndUserID() (mobile, userID string) {
}
return mobile, userID
}
func (ctx *Context) GetUserID() (userID string) {
token := ctx.GetToken()
authInfo, err2 := auth2.GetTokenInfo(token)
if err2 == nil {
if authInfo.TokenType == auth2.TokenTypeNormal {
userID = authInfo.GetID()
}
}
return userID
}