feat(#I12VKS): 后台网站标题页脚与默认应用一致

comment #I12VKS
已登陆用户后台管理页面显示的网站标题跟页脚与个人中心设置的默认应用内设置的显示一致

link #I12VKS
This commit is contained in:
Argo Zhang 2019-10-01 10:29:38 +08:00
parent 07126c3d09
commit f30189ef44
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
5 changed files with 24 additions and 13 deletions

View File

@ -24,6 +24,10 @@ namespace Bootstrap.Admin.Models
AppCode = user.App;
Css = user.Css;
ActiveCss = string.IsNullOrEmpty(Css) ? Theme : Css;
// 通过 AppCode 获取用户默认应用的标题
Title = DictHelper.RetrieveWebTitle(AppCode);
Footer = DictHelper.RetrieveWebFooter(AppCode);
}
}

View File

@ -29,12 +29,12 @@ namespace Bootstrap.Admin.Models
/// <summary>
/// 获取 网站标题
/// </summary>
public string Title { get; private set; }
public string Title { get; protected set; }
/// <summary>
/// 获取 网站页脚
/// </summary>
public string Footer { get; private set; }
public string Footer { get; protected set; }
/// <summary>
/// 网站样式全局设置

View File

@ -74,21 +74,23 @@ namespace Bootstrap.DataAccess.MongoDB
}
/// <summary>
///
/// 获得网站标题设置
/// </summary>
/// <param name="appId"></param>
/// <returns></returns>
public override string RetrieveWebTitle()
public override string RetrieveWebTitle(string appId = "0")
{
var code = RetrieveAppName("网站标题");
var code = RetrieveAppName("网站标题", appId);
if (code == "网站标题未设置") code = DictHelper.RetrieveDicts().FirstOrDefault(d => d.Name == "网站标题" && d.Category == "网站设置" && d.Define == 0)?.Code ?? "后台管理系统";
return code;
}
/// <summary>
///
/// 获得网站页脚设置
/// </summary>
/// <param name="appId"></param>
/// <returns></returns>
public override string RetrieveWebFooter()
public override string RetrieveWebFooter(string appId = "0")
{
var code = RetrieveAppName("网站页脚");
if (code == "网站页脚未设置") code = DictHelper.RetrieveDicts().FirstOrDefault(d => d.Name == "网站页脚" && d.Category == "网站设置" && d.Define == 0)?.Code ?? "2016 © 通用后台管理系统";

View File

@ -63,11 +63,13 @@ namespace Bootstrap.DataAccess
/// <summary>
/// 获取系统网站标题
/// </summary>
/// <param name="appId"></param>
/// <returns></returns>
public virtual string RetrieveWebTitle()
public virtual string RetrieveWebTitle(string appId = "0")
{
// 优先查找配置的应用程序网站标题
var code = DbHelper.RetrieveTitle();
var code = DbHelper.RetrieveTitle(appId);
if (code == "网站标题未设置") code = DictHelper.RetrieveDicts().FirstOrDefault(d => d.Name == "网站标题" && d.Category == "网站设置" && d.Define == 0)?.Code ?? "后台管理系统";
return code;
}
@ -75,11 +77,12 @@ namespace Bootstrap.DataAccess
/// <summary>
/// 获取系统网站页脚
/// </summary>
/// <param name="appId"></param>
/// <returns></returns>
public virtual string RetrieveWebFooter()
public virtual string RetrieveWebFooter(string appId = "0")
{
// 优先查找配置的应用程序网站标题
var code = DbHelper.RetrieveFooter();
var code = DbHelper.RetrieveFooter(appId);
if (code == "网站页脚未设置") code = DictHelper.RetrieveDicts().FirstOrDefault(d => d.Name == "网站页脚" && d.Category == "网站设置" && d.Define == 0)?.Code ?? "2016 © 通用后台管理系统";
return code;
}

View File

@ -98,14 +98,16 @@ namespace Bootstrap.DataAccess
/// <summary>
/// 获取站点 Title 配置信息
/// </summary>
/// <param name="appId"></param>
/// <returns></returns>
public static string RetrieveWebTitle() => DbContextManager.Create<Dict>().RetrieveWebTitle();
public static string RetrieveWebTitle(string appId = "0") => DbContextManager.Create<Dict>().RetrieveWebTitle(appId);
/// <summary>
/// 获取站点 Footer 配置信息
/// </summary>
/// <param name="appId"></param>
/// <returns></returns>
public static string RetrieveWebFooter() => DbContextManager.Create<Dict>().RetrieveWebFooter();
public static string RetrieveWebFooter(string appId = "0") => DbContextManager.Create<Dict>().RetrieveWebFooter(appId);
/// <summary>
/// 获得系统中配置的可以使用的网站样式