|
|
@ -17,7 +17,9 @@ import com.ruoyi.common.annotation.Log;
|
|
|
|
import com.ruoyi.common.base.AjaxResult;
|
|
|
|
import com.ruoyi.common.base.AjaxResult;
|
|
|
|
import com.ruoyi.common.config.Global;
|
|
|
|
import com.ruoyi.common.config.Global;
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
|
|
|
|
import com.ruoyi.framework.shiro.service.PasswordService;
|
|
|
|
import com.ruoyi.framework.util.FileUploadUtils;
|
|
|
|
import com.ruoyi.framework.util.FileUploadUtils;
|
|
|
|
|
|
|
|
import com.ruoyi.framework.util.ShiroUtils;
|
|
|
|
import com.ruoyi.system.domain.SysUser;
|
|
|
|
import com.ruoyi.system.domain.SysUser;
|
|
|
|
import com.ruoyi.system.service.ISysDictDataService;
|
|
|
|
import com.ruoyi.system.service.ISysDictDataService;
|
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
@ -39,6 +41,9 @@ public class SysProfileController extends BaseController
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private ISysUserService userService;
|
|
|
|
private ISysUserService userService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private PasswordService passwordService;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private ISysDictDataService dictDataService;
|
|
|
|
private ISysDictDataService dictDataService;
|
|
|
|
|
|
|
|
|
|
|
@ -81,6 +86,8 @@ public class SysProfileController extends BaseController
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public AjaxResult resetPwd(SysUser user)
|
|
|
|
public AjaxResult resetPwd(SysUser user)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
user.setSalt(ShiroUtils.randomSalt());
|
|
|
|
|
|
|
|
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
|
|
|
int rows = userService.resetUserPwd(user);
|
|
|
|
int rows = userService.resetUserPwd(user);
|
|
|
|
if (rows > 0)
|
|
|
|
if (rows > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|