refactor: SessionUser -> SessionUsername

Signed-off-by: Kininaru <shiftregister233@outlook.com>
This commit is contained in:
Kininaru
2021-07-18 07:15:22 +08:00
committed by Yang Luo
parent 59602a1325
commit d83b86df37
6 changed files with 16 additions and 16 deletions

View File

@ -170,7 +170,7 @@ func (c *ApiController) SetPassword() {
oldPassword := c.Ctx.Request.Form.Get("oldPassword")
newPassword := c.Ctx.Request.Form.Get("newPassword")
requestUserId := c.GetSessionUser()
requestUserId := c.GetSessionUsername()
if requestUserId == "" {
c.ResponseError("Please login first.")
return
@ -223,7 +223,7 @@ func (c *ApiController) SetPassword() {
return
}
c.SetSessionUser("")
c.SetSessionUsername("")
targetUser.Password = newPassword
object.SetUserField(targetUser, "password", targetUser.Password)