Commit f40c2dc7 authored by JiangSN's avatar JiangSN

修复角色管理页面报错

parent 593ee9ca
......@@ -76,7 +76,7 @@ public class Role extends BaseEntity implements Serializable {
@Column(name = "role_level")
@ApiModelProperty(value = "级别,数值越小,级别越大")
private Integer role_level = 3;
private Integer level = 3;
@ApiModelProperty(value = "描述")
private String description;
......
......@@ -97,7 +97,7 @@ public class RoleController {
if (resources.getId() != null) {
throw new BadRequestException("A new " + ENTITY_NAME + " cannot already have an ID");
}
getLevels(resources.getRole_level());
getLevels(resources.getLevel());
roleService.create(resources);
return new ResponseEntity<>(HttpStatus.CREATED);
}
......@@ -107,7 +107,7 @@ public class RoleController {
@PutMapping
@PreAuthorize("@el.check('roles:edit')")
public ResponseEntity<Object> update(@Validated(Role.Update.class) @RequestBody Role resources) {
getLevels(resources.getRole_level());
getLevels(resources.getLevel());
roleService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
......
......@@ -114,7 +114,7 @@ public class RoleServiceImpl implements RoleService {
role.setDescription(resources.getDescription());
role.setDataScope(resources.getDataScope());
role.setDepts(resources.getDepts());
role.setRole_level(resources.getRole_level());
role.setLevel(resources.getLevel());
roleRepository.save(role);
// 更新相关缓存
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