|
|
|
@ -18,7 +18,6 @@ import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
|
|
|
|
import com.ruoyi.framework.util.ShiroUtils;
|
|
|
|
@ -159,11 +158,8 @@ public class SysUserController extends BaseController
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult editSave(@Validated SysUser user)
|
|
|
|
|
{
|
|
|
|
|
if (StringUtils.isNotNull(user.getUserId()) && SysUser.isAdmin(user.getUserId()))
|
|
|
|
|
{
|
|
|
|
|
return error("不允许修改超级管理员用户");
|
|
|
|
|
}
|
|
|
|
|
else if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
|
|
|
|
userService.checkUserAllowed(user);
|
|
|
|
|
if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
|
|
|
|
{
|
|
|
|
|
return error("修改用户'" + user.getLoginName() + "'失败,手机号码已存在");
|
|
|
|
|
}
|
|
|
|
@ -190,6 +186,7 @@ public class SysUserController extends BaseController
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult resetPwdSave(SysUser user)
|
|
|
|
|
{
|
|
|
|
|
userService.checkUserAllowed(user);
|
|
|
|
|
user.setSalt(ShiroUtils.randomSalt());
|
|
|
|
|
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
|
|
|
|
if (userService.resetUserPwd(user) > 0)
|
|
|
|
@ -258,6 +255,7 @@ public class SysUserController extends BaseController
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult changeStatus(SysUser user)
|
|
|
|
|
{
|
|
|
|
|
userService.checkUserAllowed(user);
|
|
|
|
|
return toAjax(userService.changeStatus(user));
|
|
|
|
|
}
|
|
|
|
|
}
|