| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:user:list')") |
| | | @PostMapping("/user/page1") |
| | | public R page1(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<User, BaseParam> pageParam = new PageParam<>(baseParam, User.class); |
| | | return R.ok().add(userService.pageRel(pageParam)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:user:list')") |
| | | @PostMapping("/user/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(userService.list()); |
| | |
| | | ExcelUtil.build(ExcelUtil.create(userService.list(), User.class), response); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('system:user:update')") |
| | | @OperationLog("重置密码") |
| | | @PostMapping("/user/reset/pwd") |
| | | public R resetPwd(@RequestBody User user) { |
| | | if (!Cools.isEmpty(user.getPassword())) { |
| | | user.setPassword(userService.encodePassword(user.getPassword())); |
| | | } |
| | | user.setUpdateBy(getLoginUserId()); |
| | | user.setUpdateTime(new Date()); |
| | | if (!userService.updateById(user)) { |
| | | return R.error("重置失败"); |
| | | } |
| | | return R.ok("重置成功"); |
| | | } |
| | | |
| | | } |