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