Skip to content

Commit

Permalink
Merge pull request #30 from dchaofei/master
Browse files Browse the repository at this point in the history
修复:更新个人设置时自动更改 password salt
  • Loading branch information
dreamans authored Jan 21, 2019
2 parents 0e350bc + 26275f2 commit e4b8416
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions module/user/my.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func MyUpdate(c *goweb.Context) error {

user.TrueName = trueName
user.Mobile = mobile
user.DoNotUpdatePassword()
if err := user.CreateOrUpdate(); err != nil {
return syncd.RenderAppError(err.Error())
}
Expand Down
4 changes: 4 additions & 0 deletions service/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,7 @@ func (u *User) transmitUserDetail(detail userModel.User) {
u.LockStatus = detail.LockStatus
u.Salt = detail.Salt
}

func (u *User) DoNotUpdatePassword() {
u.Password = ""
}

0 comments on commit e4b8416

Please sign in to comment.