| | |
| | | } |
| | | } |
| | | |
| | | @Log("后台用户删除") |
| | | @PostMapping("/del/{adminId}") |
| | | @GetMapping("/del/{adminId}") |
| | | public ResponseVO<Object> deleteAdmin(@PathVariable Long adminId) { |
| | | if (!permissionConfig.check(MenuEnum.ADMIN_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = adminService.deleteAdmin(adminId); |
| | | if (result) { |
| | | return ResponseUtil.success("修改成功"); |
| | | return ResponseUtil.success("删除管理员成功!"); |
| | | } else { |
| | | return ResponseUtil.fail("修改失败"); |
| | | return ResponseUtil.fail("删除管理员失败!"); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return ResponseUtil.success(userPermissionList); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/creatUserKey") |
| | | public ResponseVO<Object> creatUserKey(@RequestParam(required = false, value = "userId") Long userId, |
| | | @RequestParam(required = false, value = "requstType") Integer requstType) { |
| | | if (!AdministratorEnums.ADMIN.getCode().equals(SecurityUtils.getAdministratorIdentity())) { |
| | | throw new BusinessException("非超级管理员无法操作!"); |
| | | } |
| | | return ResponseUtil.success(adminService.creatUserKey(userId, requstType)); |
| | | } |
| | | } |