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) {