feat(rbac): 添加Vben5菜单
This commit is contained in:
@@ -423,7 +423,7 @@ namespace Yi.Framework.Rbac.Application.Services
|
||||
{
|
||||
//将后端菜单转换成前端路由,组件级别需要过滤
|
||||
output =
|
||||
ObjectMapper.Map<List<MenuDto>, List<MenuAggregateRoot>>(menus.Where(x=>x.MenuSource==MenuSourceEnum.Ruoyi).ToList()).Vue3RuoYiRouterBuild();
|
||||
ObjectMapper.Map<List<MenuDto>, List<MenuAggregateRoot>>(menus.Where(x=>x.MenuSource==MenuSourceEnum.Ruoyi).ToList()).Vue3RuoYiRouterBuild(MenuSourceEnum.Ruoyi);
|
||||
}
|
||||
else if (routerType == "pure")
|
||||
{
|
||||
@@ -431,6 +431,12 @@ namespace Yi.Framework.Rbac.Application.Services
|
||||
output =
|
||||
ObjectMapper.Map<List<MenuDto>, List<MenuAggregateRoot>>(menus.Where(x=>x.MenuSource==MenuSourceEnum.Pure).ToList()).Vue3PureRouterBuild();
|
||||
}
|
||||
else if ( routerType == "vben5")
|
||||
{
|
||||
//将后端菜单转换成前端路由,组件级别需要过滤
|
||||
output =
|
||||
ObjectMapper.Map<List<MenuDto>, List<MenuAggregateRoot>>(menus.Where(x=>x.MenuSource==MenuSourceEnum.Vben5).ToList()).Vue3RuoYiRouterBuild(MenuSourceEnum.Vben5);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
public enum MenuSourceEnum
|
||||
{
|
||||
Ruoyi=0,
|
||||
Pure=1
|
||||
Pure=1,
|
||||
Vben5=2
|
||||
}
|
||||
@@ -168,12 +168,12 @@ namespace Yi.Framework.Rbac.Domain.Entities
|
||||
/// </summary>
|
||||
/// <param name="menus"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Vue3RouterDto> Vue3RuoYiRouterBuild(this List<MenuAggregateRoot> menus)
|
||||
public static List<Vue3RouterDto> Vue3RuoYiRouterBuild(this List<MenuAggregateRoot> menus,MenuSourceEnum menuSource)
|
||||
{
|
||||
menus = menus
|
||||
.Where(m => m.State == true)
|
||||
.Where(m => m.MenuType != MenuTypeEnum.Component)
|
||||
.Where(m => m.MenuSource == MenuSourceEnum.Ruoyi)
|
||||
.Where(m => m.MenuSource == menuSource)
|
||||
.ToList();
|
||||
List<Vue3RouterDto> routers = new();
|
||||
foreach (var m in menus)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user