From ff2140b03974c95b9a5550fd5688e485db37e39a Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 11 Oct 2018 20:27:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF-=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/web/controller/system/SysProfileController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java index 8730d245..f3f0d086 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java @@ -17,7 +17,9 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.base.AjaxResult; import com.ruoyi.common.config.Global; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.framework.shiro.service.PasswordService; import com.ruoyi.framework.util.FileUploadUtils; +import com.ruoyi.framework.util.ShiroUtils; import com.ruoyi.system.domain.SysUser; import com.ruoyi.system.service.ISysDictDataService; import com.ruoyi.system.service.ISysUserService; @@ -38,6 +40,9 @@ public class SysProfileController extends BaseController @Autowired private ISysUserService userService; + + @Autowired + private PasswordService passwordService; @Autowired private ISysDictDataService dictDataService; @@ -81,6 +86,8 @@ public class SysProfileController extends BaseController @ResponseBody public AjaxResult resetPwd(SysUser user) { + user.setSalt(ShiroUtils.randomSalt()); + user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt())); int rows = userService.resetUserPwd(user); if (rows > 0) {