Commit f40c2dc7 authored by JiangSN's avatar JiangSN

修复角色管理页面报错

parent 593ee9ca
...@@ -76,7 +76,7 @@ public class Role extends BaseEntity implements Serializable { ...@@ -76,7 +76,7 @@ public class Role extends BaseEntity implements Serializable {
@Column(name = "role_level") @Column(name = "role_level")
@ApiModelProperty(value = "级别,数值越小,级别越大") @ApiModelProperty(value = "级别,数值越小,级别越大")
private Integer role_level = 3; private Integer level = 3;
@ApiModelProperty(value = "描述") @ApiModelProperty(value = "描述")
private String description; private String description;
......
...@@ -97,7 +97,7 @@ public class RoleController { ...@@ -97,7 +97,7 @@ public class RoleController {
if (resources.getId() != null) { if (resources.getId() != null) {
throw new BadRequestException("A new " + ENTITY_NAME + " cannot already have an ID"); throw new BadRequestException("A new " + ENTITY_NAME + " cannot already have an ID");
} }
getLevels(resources.getRole_level()); getLevels(resources.getLevel());
roleService.create(resources); roleService.create(resources);
return new ResponseEntity<>(HttpStatus.CREATED); return new ResponseEntity<>(HttpStatus.CREATED);
} }
...@@ -107,7 +107,7 @@ public class RoleController { ...@@ -107,7 +107,7 @@ public class RoleController {
@PutMapping @PutMapping
@PreAuthorize("@el.check('roles:edit')") @PreAuthorize("@el.check('roles:edit')")
public ResponseEntity<Object> update(@Validated(Role.Update.class) @RequestBody Role resources) { public ResponseEntity<Object> update(@Validated(Role.Update.class) @RequestBody Role resources) {
getLevels(resources.getRole_level()); getLevels(resources.getLevel());
roleService.update(resources); roleService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT); return new ResponseEntity<>(HttpStatus.NO_CONTENT);
} }
......
...@@ -114,7 +114,7 @@ public class RoleServiceImpl implements RoleService { ...@@ -114,7 +114,7 @@ public class RoleServiceImpl implements RoleService {
role.setDescription(resources.getDescription()); role.setDescription(resources.getDescription());
role.setDataScope(resources.getDataScope()); role.setDataScope(resources.getDataScope());
role.setDepts(resources.getDepts()); role.setDepts(resources.getDepts());
role.setRole_level(resources.getRole_level()); role.setLevel(resources.getLevel());
roleRepository.save(role); roleRepository.save(role);
// 更新相关缓存 // 更新相关缓存
delCaches(role.getId(), null); delCaches(role.getId(), null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment