fix: 个人中心设置为前台站点时网站图标显示前台图标

This commit is contained in:
Argo Zhang 2020-02-27 16:52:55 +08:00
parent fe30ec09e8
commit 8f6263814c
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 22 additions and 2 deletions

View File

@ -39,9 +39,19 @@ namespace Bootstrap.DataAccess
public static string RetrieveWebIcon(string appId)
{
// 获取应用程序 logo
var ret = "~/favicon.ico";
var ditcs = RetrieveDicts();
var platName = ditcs.FirstOrDefault(d => d.Category == "应用程序" && d.Code == appId)?.Name;
return ditcs.FirstOrDefault(d => d.Category == platName && d.Name == "favicon")?.Code ?? $"~/favicon.ico";
if (!string.IsNullOrEmpty(platName))
{
var pathBase = ditcs.FirstOrDefault(d => d.Category == "应用首页" && d.Name == appId)?.Code;
if (!string.IsNullOrEmpty(pathBase))
{
var favIcon = ditcs.FirstOrDefault(d => d.Category == platName && d.Name == "favicon")?.Code;
if (!string.IsNullOrEmpty(favIcon)) ret = $"{pathBase}{favIcon}";
}
}
return ret;
}
/// <summary>
@ -52,9 +62,19 @@ namespace Bootstrap.DataAccess
public static string RetrieveWebLogo(string appId)
{
// 获取应用程序 logo
var ret = "~/favicon.png";
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";
if (!string.IsNullOrEmpty(platName))
{
var pathBase = ditcs.FirstOrDefault(d => d.Category == "应用首页" && d.Name == appId)?.Code;
if (!string.IsNullOrEmpty(pathBase))
{
var favIcon = ditcs.FirstOrDefault(d => d.Category == platName && d.Name == "网站图标")?.Code;
if (!string.IsNullOrEmpty(favIcon)) ret = $"{pathBase}{favIcon}";
}
}
return ret;
}
/// <summary>