Fix avatar URL.

This commit is contained in:
Yang Luo
2021-05-09 12:07:09 +08:00
parent 5a3abdbc95
commit efab90ef3f
2 changed files with 4 additions and 3 deletions

View File

@ -197,7 +197,7 @@ func (c *ApiController) UploadAvatar() {
c.ServeJSON()
return
}
user.Avatar = fmt.Sprintf("%s%s.png?time=%s", object.GetAvatarPath(), user.Name, util.GetCurrentUnixTime())
user.Avatar = fmt.Sprintf("%s%s.png?time=%s", object.GetAvatarPath(), user.GetId(), util.GetCurrentUnixTime())
object.UpdateUser(user.GetId(), user)
resp = Response{Status: "ok", Msg: ""}
c.Data["json"] = resp