|
@@ -57,8 +57,8 @@ public class SysUserController extends BaseController {
|
|
|
* 获取用户列表
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
|
|
- @GetMapping("/list")
|
|
|
- public TableDataInfo list(SysUser user) {
|
|
|
+ @PostMapping("/list")
|
|
|
+ public TableDataInfo list(@RequestBody SysUser user) {
|
|
|
startPage();
|
|
|
List<SysUser> list = userService.selectUserList(user);
|
|
|
return getDataTable(list);
|
|
@@ -107,14 +107,14 @@ public class SysUserController extends BaseController {
|
|
|
* 根据用户编号获取详细信息
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
|
|
- @GetMapping(value = {"/", "/{userId}"})
|
|
|
- public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
|
|
|
- userService.checkUserDataScope(userId);
|
|
|
+ @GetMapping(value = {"/", "/{id}"})
|
|
|
+ public AjaxResult getInfo(@PathVariable(value = "id", required = false) Long id) {
|
|
|
+ userService.checkUserDataScope(id);
|
|
|
AjaxResult ajax = AjaxResult.success();
|
|
|
List<SysRole> roles = roleService.selectRoleAll();
|
|
|
- ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
|
|
- if (StringUtils.isNotNull(userId)) {
|
|
|
- SysUser sysUser = userService.selectUserById(userId);
|
|
|
+ ajax.put("roles", SysUser.isAdmin(id) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
|
|
+ if (StringUtils.isNotNull(id)) {
|
|
|
+ SysUser sysUser = userService.selectUserById(id);
|
|
|
ajax.put(AjaxResult.DATA_TAG, sysUser);
|
|
|
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
|
|
}
|