Merge branch 'refs/heads/pure-dev' into abp
This commit is contained in:
@@ -275,11 +275,12 @@ namespace Yi.Framework.Rbac.Application.Services
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前登录用户的前端路由
|
||||
/// 支持ruoyi/pure
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Authorize]
|
||||
[Route("account/Vue3Router")]
|
||||
public async Task<List<Vue3RouterDto>> GetVue3Router()
|
||||
[Route("account/Vue3Router/{routerType?}")]
|
||||
public async Task<object> GetVue3Router([FromRoute]string? routerType)
|
||||
{
|
||||
var userId = _currentUser.Id;
|
||||
if (_currentUser.Id is null)
|
||||
@@ -296,10 +297,20 @@ namespace Yi.Framework.Rbac.Application.Services
|
||||
menus = ObjectMapper.Map<List<MenuAggregateRoot>, List<MenuDto>>(await _menuRepository.GetListAsync());
|
||||
}
|
||||
|
||||
//将后端菜单转换成前端路由,组件级别需要过滤
|
||||
List<Vue3RouterDto> routers =
|
||||
ObjectMapper.Map<List<MenuDto>, List<MenuAggregateRoot>>(menus).Vue3RouterBuild();
|
||||
return routers;
|
||||
object output = null;
|
||||
if (routerType is null ||routerType=="ruoyi")
|
||||
{
|
||||
//将后端菜单转换成前端路由,组件级别需要过滤
|
||||
output =
|
||||
ObjectMapper.Map<List<MenuDto>, List<MenuAggregateRoot>>(menus).Vue3RuoYiRouterBuild();
|
||||
}
|
||||
else if (routerType =="pure")
|
||||
{
|
||||
//将后端菜单转换成前端路由,组件级别需要过滤
|
||||
output =
|
||||
ObjectMapper.Map<List<MenuDto>, List<MenuAggregateRoot>>(menus).Vue3PureRouterBuild();
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
|
||||
var entities = await _repository._DbQueryable.WhereIF(!string.IsNullOrEmpty(input.MenuName), x => x.MenuName.Contains(input.MenuName!))
|
||||
.WhereIF(input.State is not null, x => x.State == input.State)
|
||||
.Where(x=>x.MenuSource==input.MenuSource)
|
||||
.OrderByDescending(x => x.OrderNum)
|
||||
.ToListAsync();
|
||||
//.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
|
||||
@@ -45,5 +46,15 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
|
||||
return await MapToGetListOutputDtosAsync(entities);
|
||||
}
|
||||
|
||||
public override Task<MenuGetOutputDto> UpdateAsync(Guid id, MenuUpdateInputVo input)
|
||||
{
|
||||
return base.UpdateAsync(id, input);
|
||||
}
|
||||
|
||||
public override Task<MenuGetOutputDto> CreateAsync(MenuCreateInputVo input)
|
||||
{
|
||||
return base.CreateAsync(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user