- user GetUserTag in jxcontext.Context.GetUserName

This commit is contained in:
gazebo
2019-03-12 17:08:41 +08:00
parent 6693bd4bf5
commit 8ce4ee0be9
3 changed files with 19 additions and 1 deletions

View File

@@ -76,3 +76,16 @@ func (a *AuthInfo) GetAuthID() string {
func (a *AuthInfo) GetAuthType() string {
return a.AuthBindInfo.Type
}
func (a *AuthInfo) GetUserTag() string {
userTag := a.UserID2
if userTag == "" {
if a.AuthBindInfo.UserHint != nil {
userTag = a.AuthBindInfo.UserHint.Mobile
}
if userTag == "" {
userTag = a.AuthBindInfo.AuthID
}
}
return userTag
}