|
@@ -253,7 +253,9 @@ public class SysController {
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "角色信息", response = TBRole.class)})
|
|
|
public Result roleList() {
|
|
|
List<TBRole> tbRoleList = (List<TBRole>) redisUtil.getRole();
|
|
|
- if (Objects.isNull(tbRoleList) || tbRoleList.size() == 0) {
|
|
|
+ if (Objects.nonNull(tbRoleList)) {
|
|
|
+ tbRoleList = (List<TBRole>) tbRoleList.get(0);
|
|
|
+ } else {
|
|
|
QueryWrapper<TBRole> tbRoleQueryWrapper = new QueryWrapper<>();
|
|
|
tbRoleQueryWrapper.lambda().notIn(TBRole::getRoleCode, RoleEnum.SUPER_ADMIN.name(), RoleEnum.STUDENT.name());
|
|
|
tbRoleList = tbRoleService.list(tbRoleQueryWrapper);
|