diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java index 73eb7709..2fe1cb86 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java @@ -155,6 +155,9 @@ public class MenuController extends BladeController { @GetMapping("auth-routes") @ApiOperation(value = "菜单的角色权限", position = 8) public R> authRoutes(BladeUser user) { + if (Func.isEmpty(user)) { + return null; + } List list = new ArrayList<>(); List routes = menuService.authRoutes(Func.toIntList(user.getRoleId())); routes.forEach(route -> list.add(Kv.create().set(route.getPath(), Kv.create().set("authority", Func.toStrArray(route.getAlias())))));