|
@@ -8,6 +8,7 @@ using ERP.Core.Entity;
|
|
|
using ERP.Core.Interface;
|
|
|
using ERP.Core.Repository;
|
|
|
using ERP.Framework.Security;
|
|
|
+using ERP.Framework.Utils;
|
|
|
|
|
|
namespace ERP.Core.Service
|
|
|
{
|
|
@@ -28,7 +29,7 @@ namespace ERP.Core.Service
|
|
|
/// 获取
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public List<SysMenu> SelectMenuListByUserId(long userId)
|
|
|
+ public List<SysMenu> SelectMenuTreeByUserId(long userId)
|
|
|
{
|
|
|
List<SysMenu> result;
|
|
|
|
|
@@ -41,7 +42,7 @@ namespace ERP.Core.Service
|
|
|
result = _sysMenuRepository.SelectMenuListByUserId(userId);
|
|
|
}
|
|
|
|
|
|
- return result;
|
|
|
+ return TreeUtil.Build(result);
|
|
|
}
|
|
|
|
|
|
public List<Router> BuildMenuTree(List<SysMenu> list, string parentPath)
|
|
@@ -53,7 +54,7 @@ namespace ERP.Core.Service
|
|
|
var router = new Router()
|
|
|
{
|
|
|
Hidden = menu.Visible,
|
|
|
- Name = menu.Path.,
|
|
|
+ Name = menu.Path,
|
|
|
Path = GetRoutePath(menu, parentPath),
|
|
|
Component = GetComponent(menu),
|
|
|
Meta = new Meta()
|
|
@@ -67,7 +68,7 @@ namespace ERP.Core.Service
|
|
|
var cMenus = menu.Children;
|
|
|
if (cMenus != null && menu.MenuType == Enum.MenuTypeEnum.Catalog)
|
|
|
{
|
|
|
- router.Chindren = BuildMenuTree(cMenus, router.Path);
|
|
|
+ router.Children = BuildMenuTree(cMenus, router.Path);
|
|
|
}
|
|
|
else if (IsMenuFrame(menu))
|
|
|
{
|
|
@@ -84,7 +85,7 @@ namespace ERP.Core.Service
|
|
|
}
|
|
|
};
|
|
|
childrenList.Add(children);
|
|
|
- router.Chindren = childrenList;
|
|
|
+ router.Children = childrenList;
|
|
|
}
|
|
|
|
|
|
routers.Add(router);
|