Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
dabc4d88b3
1 file changed
+6
@@ -356,6 +356,12 @@ func (e SysUser) UpdatePwd(c *gin.Context) {
|
||||
if user.GetUserId(c) == 1 && config.ApplicationConfig.Mode == "demo" {
|
||||
req.NewPassword = "123456"
|
||||
}
|
||||
|
||||
var hash []byte
|
||||
if hash, err = bcrypt.GenerateFromPassword([]byte(req.NewPassword), bcrypt.DefaultCost); err != nil {
|
||||
req.NewPassword = string(hash)
|
||||
}
|
||||
|
||||
err = s.UpdatePwd(user.GetUserId(c), req.OldPassword, req.NewPassword, p)
|
||||
if err != nil {
|
||||
e.Logger.Error(err)
|
||||
|
||||
Reference in new issue
Block a user