添加User.Avatar
This commit is contained in:
@@ -52,6 +52,7 @@ type IUser interface {
|
||||
GetMobile() string
|
||||
GetEmail() string
|
||||
GetName() string
|
||||
GetAvatar() string
|
||||
}
|
||||
|
||||
const (
|
||||
|
||||
@@ -18,6 +18,7 @@ type UserBasic struct {
|
||||
Mobile string `json:"mobile"`
|
||||
Email string `json:"email"`
|
||||
Name string `json:"name"`
|
||||
Avatar string `json:"avatar"`
|
||||
}
|
||||
|
||||
func (u *UserBasic) GetID() string {
|
||||
@@ -39,6 +40,10 @@ func (u *UserBasic) GetName() string {
|
||||
return u.Name
|
||||
}
|
||||
|
||||
func (u *UserBasic) GetAvatar() string {
|
||||
return u.Avatar
|
||||
}
|
||||
|
||||
func (u *UserBasic) UpdateByIUser(user IUser) {
|
||||
if user != nil {
|
||||
u.UserID = user.GetID()
|
||||
@@ -46,6 +51,7 @@ func (u *UserBasic) UpdateByIUser(user IUser) {
|
||||
u.Mobile = user.GetMobile()
|
||||
u.Email = user.GetEmail()
|
||||
u.Name = user.GetName()
|
||||
u.Avatar = user.GetAvatar()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,8 @@ func (a *Auther) VerifySecret(state, code string) (authBindEx *auth2.AuthBindEx,
|
||||
if err = err2; err == nil {
|
||||
if authBindEx, err = a.UnionFindAuthBind(a.authType, []string{AuthTypeWeixin, AuthTypeMP, AuthTypeMini}, wxUserinfo.OpenID, wxUserinfo.UnionID, wxUserinfo); err == nil {
|
||||
authBindEx.UserHint = &auth2.UserBasic{
|
||||
Name: wxUserinfo.NickName,
|
||||
Name: wxUserinfo.NickName,
|
||||
Avatar: wxUserinfo.HeadImgURL,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user