Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhangwenjian committed 2022-07-27 21:34:07 +08:00
commit dabc4d88b3
1 file changed
+6
+6
View File
@@ -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)