From 616c4c5df90198ea559156e9bed939e2303604a1 Mon Sep 17 00:00:00 2001 From: smallchill Date: Sun, 17 Feb 2019 21:07:34 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/springblade/system/controller/MenuController.java | 3 +++ 1 file changed, 3 insertions(+) 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())))));