| | |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.support.Kv; |
| | |
| | | @GetMapping("/routes") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "前端菜单数据", notes = "前端菜单数据") |
| | | public R<List<MenuVO>> routes(BladeUser user, Long topMenuId) { |
| | | List<MenuVO> list = menuService.routes((user == null) ? null : user.getRoleId(), topMenuId); |
| | | public R<List<MenuVO>> routes(Long topMenuId) { |
| | | List<MenuVO> list = menuService.routes(AuthUtil.getUser().getRoleId(), topMenuId); |
| | | return R.data(list); |
| | | } |
| | | |
| | |
| | | @GetMapping("/routes-ext") |
| | | @ApiOperationSupport(order = 9) |
| | | @ApiOperation(value = "前端菜单数据", notes = "前端菜单数据") |
| | | public R<List<MenuVO>> routesExt(BladeUser user, Long topMenuId) { |
| | | List<MenuVO> list = menuService.routesExt(user.getRoleId(), topMenuId); |
| | | public R<List<MenuVO>> routesExt(Long topMenuId) { |
| | | List<MenuVO> list = menuService.routesExt(AuthUtil.getUser().getRoleId(), topMenuId); |
| | | return R.data(list); |
| | | } |
| | | |
| | |
| | | @GetMapping("/buttons") |
| | | @ApiOperationSupport(order = 10) |
| | | @ApiOperation(value = "前端按钮数据", notes = "前端按钮数据") |
| | | public R<List<MenuVO>> buttons(BladeUser user) { |
| | | List<MenuVO> list = menuService.buttons(user.getRoleId()); |
| | | public R<List<MenuVO>> buttons() { |
| | | List<MenuVO> list = menuService.buttons(AuthUtil.getUser().getRoleId()); |
| | | return R.data(list); |
| | | } |
| | | |
| | |
| | | @GetMapping("/grant-tree") |
| | | @ApiOperationSupport(order = 12) |
| | | @ApiOperation(value = "权限分配树形结构", notes = "权限分配树形结构") |
| | | public R<GrantTreeVO> grantTree(BladeUser user) { |
| | | public R<GrantTreeVO> grantTree() { |
| | | BladeUser user = AuthUtil.getUser(); |
| | | GrantTreeVO vo = new GrantTreeVO(); |
| | | vo.setMenu(menuService.grantTree(user)); |
| | | vo.setDataScope(menuService.grantDataScopeTree(user)); |
| | |
| | | @GetMapping("/grant-top-tree") |
| | | @ApiOperationSupport(order = 14) |
| | | @ApiOperation(value = "顶部菜单树形结构", notes = "顶部菜单树形结构") |
| | | public R<GrantTreeVO> grantTopTree(BladeUser user) { |
| | | public R<GrantTreeVO> grantTopTree() { |
| | | BladeUser user = AuthUtil.getUser(); |
| | | GrantTreeVO vo = new GrantTreeVO(); |
| | | vo.setMenu(menuService.grantTopTree(user)); |
| | | return R.data(vo); |
| | |
| | | @GetMapping("/top-menu") |
| | | @ApiOperationSupport(order = 16) |
| | | @ApiOperation(value = "顶部菜单数据", notes = "顶部菜单数据") |
| | | public R<List<TopMenu>> topMenu(BladeUser user) { |
| | | public R<List<TopMenu>> topMenu() { |
| | | BladeUser user = AuthUtil.getUser(); |
| | | if (Func.isEmpty(user)) { |
| | | return null; |
| | | } |
| | |
| | | @GetMapping("auth-routes") |
| | | @ApiOperationSupport(order = 17) |
| | | @ApiOperation(value = "菜单的角色权限") |
| | | public R<List<Kv>> authRoutes(BladeUser user) { |
| | | public R<List<Kv>> authRoutes() { |
| | | BladeUser user = AuthUtil.getUser(); |
| | | if (Func.isEmpty(user)) { |
| | | return null; |
| | | } |