refactor: 重构 NavigationBarModel 提高性能

This commit is contained in:
Argo Window10 2019-12-12 22:43:41 +08:00
parent 37f742cca2
commit 81948f4693
1 changed files with 2 additions and 2 deletions

View File

@ -28,9 +28,9 @@ namespace Bootstrap.Admin.Models
/// <param name="activeUrl"></param>
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<string, string>[0] : DictHelper.RetrieveApps().Where(app => app.Key.IsNullOrEmpty() || authApps.Any(key => key.Equals(app.Key, StringComparison.OrdinalIgnoreCase)));
}
/// <summary>