From 81948f4693dbc2d68adb157d0bea0a0ae34e9776 Mon Sep 17 00:00:00 2001 From: Argo Window10 Date: Thu, 12 Dec 2019 22:43:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=20NavigationBarM?= =?UTF-8?q?odel=20=E6=8F=90=E9=AB=98=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/Bootstrap.Admin/Models/NavigatorBarModel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/admin/Bootstrap.Admin/Models/NavigatorBarModel.cs b/src/admin/Bootstrap.Admin/Models/NavigatorBarModel.cs index dfad8504..fe7775d5 100644 --- a/src/admin/Bootstrap.Admin/Models/NavigatorBarModel.cs +++ b/src/admin/Bootstrap.Admin/Models/NavigatorBarModel.cs @@ -28,9 +28,9 @@ namespace Bootstrap.Admin.Models /// public NavigatorBarModel(string? userName, string activeUrl = "") : base(userName) { - Navigations = MenuHelper.RetrieveSystemMenus(UserName, activeUrl); + Navigations = MenuHelper.RetrieveSystemMenus(userName, activeUrl); var authApps = AppHelper.RetrievesByUserName(userName); - Applications = DictHelper.RetrieveApps().Where(app => app.Key.IsNullOrEmpty() || authApps.Any(key => key.Equals(app.Key, StringComparison.OrdinalIgnoreCase))); + Applications = string.IsNullOrEmpty(userName) ? new KeyValuePair[0] : DictHelper.RetrieveApps().Where(app => app.Key.IsNullOrEmpty() || authApps.Any(key => key.Equals(app.Key, StringComparison.OrdinalIgnoreCase))); } ///