修复个人信息-修改密码

pull/31/head
RuoYi 6 years ago
parent b5e8432e2f
commit 5285003dee

@ -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;
@ -39,6 +41,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)
{

Loading…
Cancel
Save