Browse Source

Signed-off-by: Lgx <361400959>

Lgx 4 years ago
parent
commit
a71393210d

+ 4 - 2
oauth2-shiro-jwt/src/main/java/com/liangjian11/ums/controller/ums/ResourceUmsController.java

@@ -211,8 +211,10 @@ public class ResourceUmsController extends BaseController {
         List<Role> roles = this.roleService.selectList(new EntityWrapper<Role>());
         for(Role role : roles)
         {
-            Option option = new Option( role.getRoleName(),role.getId(), role.getRecordState() == 2?false:true );
-            options.add(option);
+            if(role!=null){
+                Option option = new Option( role.getRoleName(),role.getId(), (role.getRecordState()!=null && role.getRecordState() == 2)?false:true );
+                options.add(option);
+            }
         }
         return ResultUtil.createSuccess(200,  options);
     }