From dca9b0c454c7099be703ea8e0b499fcc04368d4d Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 6 Oct 2019 22:12:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(#I12VKZ):=20=E7=BD=91=E7=AB=99=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E4=B8=8E=E5=89=8D=E5=8F=B0=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #Comment comment #I12VKZ #Issue link #I12VKZ --- .../Models/NavigatorBarModel.cs | 21 +++++++++++++------ .../Views/Shared/Navigator.cshtml | 2 +- .../Bootstrap.DataAccess/Helper/DictHelper.cs | 13 ++++++++++++ 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/admin/Bootstrap.Admin/Models/NavigatorBarModel.cs b/src/admin/Bootstrap.Admin/Models/NavigatorBarModel.cs index 67248c9d..e795f92a 100644 --- a/src/admin/Bootstrap.Admin/Models/NavigatorBarModel.cs +++ b/src/admin/Bootstrap.Admin/Models/NavigatorBarModel.cs @@ -8,12 +8,12 @@ using System.Linq; namespace Bootstrap.Admin.Models { /// - /// + /// 侧边栏导航条 Model /// public class NavigatorBarModel : HeaderBarModel { /// - /// + /// 构造函数 /// /// public NavigatorBarModel(ControllerBase controller) : base(controller.User.Identity) @@ -21,16 +21,25 @@ namespace Bootstrap.Admin.Models Navigations = MenuHelper.RetrieveSystemMenus(UserName, $"~{controller.HttpContext.Request.Path}"); var authApps = AppHelper.RetrievesByUserName(controller.User.Identity.Name); Applications = DictHelper.RetrieveApps().Where(app => app.Key == "0" || authApps.Any(key => key.Equals(app.Key, StringComparison.OrdinalIgnoreCase))); + + // feat: https://gitee.com/LongbowEnterprise/dashboard/issues?id=I12VKZ + // 后台系统网站图标跟随个人中心设置的默认应用站点的展示 + WebSiteLogo = DictHelper.RetrieveWebLogo(AppId); } - + /// - /// + /// 获得 网站图标 + /// + public string WebSiteLogo { get; protected set; } + + /// + /// 获得 网站菜单 /// public IEnumerable Navigations { get; private set; } /// - /// + /// 获得 网站应用程序 /// public IEnumerable> Applications { get; private set; } } -} \ No newline at end of file +} diff --git a/src/admin/Bootstrap.Admin/Views/Shared/Navigator.cshtml b/src/admin/Bootstrap.Admin/Views/Shared/Navigator.cshtml index 241b1808..0aa5f2ad 100644 --- a/src/admin/Bootstrap.Admin/Views/Shared/Navigator.cshtml +++ b/src/admin/Bootstrap.Admin/Views/Shared/Navigator.cshtml @@ -3,7 +3,7 @@
diff --git a/src/admin/Bootstrap.DataAccess/Helper/DictHelper.cs b/src/admin/Bootstrap.DataAccess/Helper/DictHelper.cs index e9aa7594..e8d42b9e 100644 --- a/src/admin/Bootstrap.DataAccess/Helper/DictHelper.cs +++ b/src/admin/Bootstrap.DataAccess/Helper/DictHelper.cs @@ -44,6 +44,19 @@ namespace Bootstrap.DataAccess return ditcs.FirstOrDefault(d => d.Category == platName && d.Name == "favicon")?.Code ?? $"~/favicon.ico"; } + /// + /// 获取网站 logo 小图标 + /// + /// + /// + public static string RetrieveWebLogo(string appId) + { + // 获取应用程序 logo + var ditcs = RetrieveDicts(); + var platName = ditcs.FirstOrDefault(d => d.Category == "应用程序" && d.Code == appId)?.Name; + return ditcs.FirstOrDefault(d => d.Category == platName && d.Name == "网站图标")?.Code ?? $"~/favicon.png"; + } + /// /// 删除字典中的数据 ///