feat(#I12VKZ): 网站图标跟随前台系统图标变化
#Comment comment #I12VKZ #Issue link #I12VKZ
This commit is contained in:
parent
5b7637ec94
commit
4b9cf379e1
|
@ -28,6 +28,10 @@ namespace Bootstrap.Admin.Models
|
|||
// 通过 AppCode 获取用户默认应用的标题
|
||||
Title = DictHelper.RetrieveWebTitle(AppId);
|
||||
Footer = DictHelper.RetrieveWebFooter(AppId);
|
||||
|
||||
// feat: https://gitee.com/LongbowEnterprise/dashboard/issues?id=I12VKZ
|
||||
// 后台系统网站图标跟随个人中心设置的默认应用站点的展示
|
||||
WebSiteLogo = DictHelper.RetrieveWebLogo(AppId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,12 +28,9 @@ namespace Bootstrap.Admin.Models
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 默认构造函数
|
||||
/// 获取 网站 logo 小图标
|
||||
/// </summary>
|
||||
public ModelBase() : this("0")
|
||||
{
|
||||
|
||||
}
|
||||
public string WebSiteLogo { get; protected set; } = "~/favicon.ico";
|
||||
|
||||
/// <summary>
|
||||
/// 获取 网站标题
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
@model ModelBase
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link rel="icon" href="~/favicon.ico" type="image/x-icon" />
|
||||
<link rel="shortcut icon" href="~/favicon.ico" type="image/x-icon" />
|
||||
<link rel="icon" href="@Url.Content(Model.WebSiteLogo)" type="image/x-icon" />
|
||||
<link rel="shortcut icon" href="@Url.Content(Model.WebSiteLogo)" type="image/x-icon" />
|
||||
<link rel="apple-touch-icon" href="~/favicon.png"/>
|
||||
<title>@ViewBag.Title</title>
|
||||
@RenderSection("css", false)
|
||||
|
|
|
@ -69,7 +69,6 @@ namespace Bootstrap.DataAccess
|
|||
{
|
||||
// 优先查找配置的应用程序网站标题
|
||||
var code = DbHelper.RetrieveTitle(appId);
|
||||
|
||||
if (code == "网站标题未设置") code = DictHelper.RetrieveDicts().FirstOrDefault(d => d.Name == "网站标题" && d.Category == "网站设置" && d.Define == 0)?.Code ?? "后台管理系统";
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -31,6 +31,19 @@ namespace Bootstrap.DataAccess
|
|||
|
||||
private static IEnumerable<BootstrapDict> RetrieveProtectedDicts() => RetrieveDicts().Where(d => d.Define == 0 || d.Category == "测试平台");
|
||||
|
||||
/// <summary>
|
||||
/// 获取网站 logo 小图标
|
||||
/// </summary>
|
||||
/// <param name="appId"></param>
|
||||
/// <returns></returns>
|
||||
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.ico";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除字典中的数据
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue