Merge branch 'ai_fix_user_avatar' into 'main'

fix user avatar Unmarshal

See merge request opensource/answer!150
This commit is contained in:
linkinstar 2022-11-01 09:28:17 +00:00
commit 2f277921bb
1 changed files with 2 additions and 4 deletions

View File

@ -96,10 +96,8 @@ func (r *GetUserToSetShowResp) GetFromUserEntity(userInfo *entity.User) {
r.Status = statusShow
}
avatarInfo := &AvatarInfo{}
err := json.Unmarshal([]byte(userInfo.Avatar), avatarInfo)
if err != nil {
log.Error("AvatarInfo json.Unmarshal Error", err)
}
_ = json.Unmarshal([]byte(userInfo.Avatar), avatarInfo)
// if json.Unmarshal Error avatarInfo.Type is Empty
r.Avatar = avatarInfo
}