|
|
@ -148,6 +148,7 @@ public class SysUserController extends BaseController |
|
|
|
public AjaxResult edit(@Validated @RequestBody SysUser user) |
|
|
|
public AjaxResult edit(@Validated @RequestBody SysUser user) |
|
|
|
{ |
|
|
|
{ |
|
|
|
userService.checkUserAllowed(user); |
|
|
|
userService.checkUserAllowed(user); |
|
|
|
|
|
|
|
userService.checkUserDataScope(user.getUserId()); |
|
|
|
if (StringUtils.isNotEmpty(user.getPhonenumber()) |
|
|
|
if (StringUtils.isNotEmpty(user.getPhonenumber()) |
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) |
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -186,6 +187,7 @@ public class SysUserController extends BaseController |
|
|
|
public AjaxResult resetPwd(@RequestBody SysUser user) |
|
|
|
public AjaxResult resetPwd(@RequestBody SysUser user) |
|
|
|
{ |
|
|
|
{ |
|
|
|
userService.checkUserAllowed(user); |
|
|
|
userService.checkUserAllowed(user); |
|
|
|
|
|
|
|
userService.checkUserDataScope(user.getUserId()); |
|
|
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
|
|
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
|
|
|
user.setUpdateBy(getUsername()); |
|
|
|
user.setUpdateBy(getUsername()); |
|
|
|
return toAjax(userService.resetPwd(user)); |
|
|
|
return toAjax(userService.resetPwd(user)); |
|
|
@ -200,6 +202,7 @@ public class SysUserController extends BaseController |
|
|
|
public AjaxResult changeStatus(@RequestBody SysUser user) |
|
|
|
public AjaxResult changeStatus(@RequestBody SysUser user) |
|
|
|
{ |
|
|
|
{ |
|
|
|
userService.checkUserAllowed(user); |
|
|
|
userService.checkUserAllowed(user); |
|
|
|
|
|
|
|
userService.checkUserDataScope(user.getUserId()); |
|
|
|
user.setUpdateBy(getUsername()); |
|
|
|
user.setUpdateBy(getUsername()); |
|
|
|
return toAjax(userService.updateUserStatus(user)); |
|
|
|
return toAjax(userService.updateUserStatus(user)); |
|
|
|
} |
|
|
|
} |
|
|
@ -227,6 +230,7 @@ public class SysUserController extends BaseController |
|
|
|
@PutMapping("/authRole") |
|
|
|
@PutMapping("/authRole") |
|
|
|
public AjaxResult insertAuthRole(Long userId, Long[] roleIds) |
|
|
|
public AjaxResult insertAuthRole(Long userId, Long[] roleIds) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
userService.checkUserDataScope(userId); |
|
|
|
userService.insertUserAuth(userId, roleIds); |
|
|
|
userService.insertUserAuth(userId, roleIds); |
|
|
|
return success(); |
|
|
|
return success(); |
|
|
|
} |
|
|
|
} |
|
|
|