Browse Source

优化代码

test
smallchill 6 years ago
parent
commit
616c4c5df9
  1. 3
      blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java

3
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") @GetMapping("auth-routes")
@ApiOperation(value = "菜单的角色权限", position = 8) @ApiOperation(value = "菜单的角色权限", position = 8)
public R<List<Kv>> authRoutes(BladeUser user) { public R<List<Kv>> authRoutes(BladeUser user) {
if (Func.isEmpty(user)) {
return null;
}
List<Kv> list = new ArrayList<>(); List<Kv> list = new ArrayList<>();
List<MenuDTO> routes = menuService.authRoutes(Func.toIntList(user.getRoleId())); List<MenuDTO> 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()))))); routes.forEach(route -> list.add(Kv.create().set(route.getPath(), Kv.create().set("authority", Func.toStrArray(route.getAlias())))));

Loading…
Cancel
Save