From ba432a06b14e20736bbd8ad074b2257c6ca15678 Mon Sep 17 00:00:00 2001 From: Argo-Surface Date: Thu, 21 Feb 2019 13:16:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=BB=84=E4=BB=B6=EF=BC=9ABo?= =?UTF-8?q?otstrap.Security.DataAccess=E7=BB=84=E4=BB=B6=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E5=88=B01.7=E4=BC=98=E5=8C=96=E5=B1=82=E6=AC=A1=E5=8C=96?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E6=8F=90=E9=AB=98=E6=80=A7=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8DIssue=20#IRT80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bootstrap.Client.DataAccess.csproj | 2 +- Bootstrap.Client.DataAccess/MenuHelper.cs | 4 +--- Bootstrap.DataAccess/Bootstrap.DataAccess.csproj | 2 +- Bootstrap.DataAccess/Helper/MenuHelper.cs | 8 ++------ 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj b/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj index 4d760050..d490e2a3 100644 --- a/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj +++ b/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj @@ -11,7 +11,7 @@ - + diff --git a/Bootstrap.Client.DataAccess/MenuHelper.cs b/Bootstrap.Client.DataAccess/MenuHelper.cs index ee8ab6f5..98155e52 100644 --- a/Bootstrap.Client.DataAccess/MenuHelper.cs +++ b/Bootstrap.Client.DataAccess/MenuHelper.cs @@ -23,9 +23,7 @@ namespace Bootstrap.Client.DataAccess public static IEnumerable RetrieveAppMenus(string userName, string activeUrl) { var menus = RetrieveAllMenus(userName).Where(m => m.Category == "1" && m.IsResource == 0 && m.Application == ConfigurationManager.AppSettings["AppId"]).Where(m => m.ParentId == "0").OrderBy(m => m.Application).ThenBy(m => m.Order); - var root = DbHelper.CascadeMenus(menus); - DbHelper.ActiveMenu(root, activeUrl); - return root; + return DbHelper.CascadeMenus(menus, activeUrl); } /// diff --git a/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj b/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj index 0b72b4e2..c411be15 100644 --- a/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj +++ b/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj @@ -11,7 +11,7 @@ - + diff --git a/Bootstrap.DataAccess/Helper/MenuHelper.cs b/Bootstrap.DataAccess/Helper/MenuHelper.cs index 2758f5ff..930c2fd2 100644 --- a/Bootstrap.DataAccess/Helper/MenuHelper.cs +++ b/Bootstrap.DataAccess/Helper/MenuHelper.cs @@ -83,9 +83,7 @@ namespace Bootstrap.DataAccess { var menus = RetrieveAllMenus(userName).Where(m => m.Category == "1" && m.IsResource == 0); if (appId != "0") menus = menus.Where(m => m.Application == appId); - var root = DbHelper.CascadeMenus(menus); - DbHelper.ActiveMenu(root, activeUrl); - return root; + return DbHelper.CascadeMenus(menus, activeUrl); } /// @@ -99,9 +97,7 @@ namespace Bootstrap.DataAccess public static IEnumerable RetrieveSystemMenus(string userName, string activeUrl = null) { var menus = RetrieveAllMenus(userName).Where(m => m.Category == "0" && m.IsResource == 0); - var root = DbHelper.CascadeMenus(menus); - DbHelper.ActiveMenu(root, activeUrl); - return root; + return DbHelper.CascadeMenus(menus, activeUrl); } ///