Skip to content

Commit 375cdf4

Browse files
committed
更换图形验证码工具,其他细节优化
1 parent 525c356 commit 375cdf4

File tree

4 files changed

+0
-33
lines changed

4 files changed

+0
-33
lines changed

eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ public ResponseEntity create(@Validated @RequestBody Menu resources){
8181
@PutMapping(value = "/menus")
8282
@PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_EDIT')")
8383
public ResponseEntity update(@Validated(Menu.Update.class) @RequestBody Menu resources){
84-
if (resources.getId() <= new Long(39).longValue()) {
85-
throw new BadRequestException("演示环境不可操作");
86-
}
8784
menuService.update(resources);
8885
return new ResponseEntity(HttpStatus.NO_CONTENT);
8986
}
@@ -92,9 +89,6 @@ public ResponseEntity update(@Validated(Menu.Update.class) @RequestBody Menu res
9289
@DeleteMapping(value = "/menus/{id}")
9390
@PreAuthorize("hasAnyRole('ADMIN','MENU_ALL','MENU_DELETE')")
9491
public ResponseEntity delete(@PathVariable Long id){
95-
if (id.longValue() <= new Long(39).longValue()) {
96-
throw new BadRequestException("演示环境不可操作");
97-
}
9892
List<Menu> menuList = menuService.findByPid(id);
9993

10094
// 特殊情况,对级联删除进行处理

eladmin-system/src/main/java/me/zhengjie/modules/system/rest/PermissionController.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ public ResponseEntity create(@Validated @RequestBody Permission resources){
6060
@PutMapping(value = "/permissions")
6161
@PreAuthorize("hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_EDIT')")
6262
public ResponseEntity update(@Validated(Permission.Update.class) @RequestBody Permission resources){
63-
if (resources.getId() <= new Long(54).longValue()) {
64-
throw new BadRequestException("演示环境不可操作");
65-
}
6663
permissionService.update(resources);
6764
return new ResponseEntity(HttpStatus.NO_CONTENT);
6865
}
@@ -71,9 +68,6 @@ public ResponseEntity update(@Validated(Permission.Update.class) @RequestBody Pe
7168
@DeleteMapping(value = "/permissions/{id}")
7269
@PreAuthorize("hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_DELETE')")
7370
public ResponseEntity delete(@PathVariable Long id){
74-
if (id <= new Long(54).longValue()) {
75-
throw new BadRequestException("演示环境不可操作");
76-
}
7771
permissionService.delete(id);
7872
return new ResponseEntity(HttpStatus.OK);
7973
}

eladmin-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ public ResponseEntity create(@Validated @RequestBody Role resources){
8282
@PutMapping(value = "/roles")
8383
@PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_EDIT')")
8484
public ResponseEntity update(@Validated(Role.Update.class) @RequestBody Role resources){
85-
if (resources.getId().equals(1L)) {
86-
throw new BadRequestException("演示环境不可操作");
87-
}
8885
roleService.update(resources);
8986
return new ResponseEntity(HttpStatus.NO_CONTENT);
9087
}
@@ -93,9 +90,6 @@ public ResponseEntity update(@Validated(Role.Update.class) @RequestBody Role res
9390
@PutMapping(value = "/roles/permission")
9491
@PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_EDIT')")
9592
public ResponseEntity updatePermission(@RequestBody Role resources){
96-
if (resources.getId().equals(1L)) {
97-
throw new BadRequestException("演示环境不可操作");
98-
}
9993
roleService.updatePermission(resources,roleService.findById(resources.getId()));
10094
return new ResponseEntity(HttpStatus.NO_CONTENT);
10195
}
@@ -104,9 +98,6 @@ public ResponseEntity updatePermission(@RequestBody Role resources){
10498
@PutMapping(value = "/roles/menu")
10599
@PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_EDIT')")
106100
public ResponseEntity updateMenu(@RequestBody Role resources){
107-
if (resources.getId().equals(1L)) {
108-
throw new BadRequestException("演示环境不可操作");
109-
}
110101
roleService.updateMenu(resources,roleService.findById(resources.getId()));
111102
return new ResponseEntity(HttpStatus.NO_CONTENT);
112103
}
@@ -115,9 +106,6 @@ public ResponseEntity updateMenu(@RequestBody Role resources){
115106
@DeleteMapping(value = "/roles/{id}")
116107
@PreAuthorize("hasAnyRole('ADMIN','ROLES_ALL','ROLES_DELETE')")
117108
public ResponseEntity delete(@PathVariable Long id){
118-
if (id.equals(1L)) {
119-
throw new BadRequestException("演示环境不可操作");
120-
}
121109
roleService.delete(id);
122110
return new ResponseEntity(HttpStatus.OK);
123111
}

eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ public ResponseEntity create(@Validated @RequestBody User resources){
102102
@PutMapping(value = "/users")
103103
@PreAuthorize("hasAnyRole('ADMIN','USER_ALL','USER_EDIT')")
104104
public ResponseEntity update(@Validated(User.Update.class) @RequestBody User resources){
105-
if (resources.getId().equals(1L)) {
106-
throw new BadRequestException("演示环境不可操作");
107-
}
108105
checkLevel(resources);
109106
userService.update(resources);
110107
return new ResponseEntity(HttpStatus.NO_CONTENT);
@@ -114,9 +111,6 @@ public ResponseEntity update(@Validated(User.Update.class) @RequestBody User res
114111
@DeleteMapping(value = "/users/{id}")
115112
@PreAuthorize("hasAnyRole('ADMIN','USER_ALL','USER_DELETE')")
116113
public ResponseEntity delete(@PathVariable Long id){
117-
if (id.equals(1L)) {
118-
throw new BadRequestException("演示环境不可操作");
119-
}
120114
Integer currentLevel = Collections.min(roleService.findByUsers_Id(SecurityUtils.getUserId()).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList()));
121115
Integer optLevel = Collections.min(roleService.findByUsers_Id(id).stream().map(RoleSmallDTO::getLevel).collect(Collectors.toList()));
122116

@@ -151,9 +145,6 @@ public ResponseEntity validPass(@RequestBody User user){
151145
@PostMapping(value = "/users/updatePass")
152146
public ResponseEntity updatePass(@RequestBody User user){
153147
UserDetails userDetails = SecurityUtils.getUserDetails();
154-
if (userDetails.getUsername().equals("admin")) {
155-
throw new BadRequestException("演示环境不可操作");
156-
}
157148
if(userDetails.getPassword().equals(EncryptUtils.encryptPassword(user.getPassword()))){
158149
throw new BadRequestException("新密码不能与旧密码相同");
159150
}

0 commit comments

Comments
 (0)