mirror of https://gitee.com/answerdev/answer.git
fix(avatar): Set user info default avatar
This commit is contained in:
parent
bbba11f5b1
commit
29eaa699e5
|
@ -100,6 +100,10 @@ func (r *GetUserToSetShowResp) GetFromUserEntity(userInfo *entity.User) {
|
||||||
}
|
}
|
||||||
avatarInfo := &AvatarInfo{}
|
avatarInfo := &AvatarInfo{}
|
||||||
_ = json.Unmarshal([]byte(userInfo.Avatar), avatarInfo)
|
_ = json.Unmarshal([]byte(userInfo.Avatar), avatarInfo)
|
||||||
|
if constant.DefaultAvatar == "gravatar" && avatarInfo.Type == "" {
|
||||||
|
avatarInfo.Type = "gravatar"
|
||||||
|
avatarInfo.Gravatar = gravatar.GetAvatarURL(userInfo.EMail)
|
||||||
|
}
|
||||||
// if json.Unmarshal Error avatarInfo.Type is Empty
|
// if json.Unmarshal Error avatarInfo.Type is Empty
|
||||||
r.Avatar = avatarInfo
|
r.Avatar = avatarInfo
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue