refactor(#I12VKZ): 字典名称更改为 favicon
#Comment comment #I12VKZ 更改字典表网站图标为 favicon #Issue link #I12VKZ
This commit is contained in:
parent
00e82fe09f
commit
f87a066257
|
@ -284,7 +284,7 @@
|
|||
},
|
||||
{
|
||||
"Category": "测试平台",
|
||||
"Name": "网站图标",
|
||||
"Name": "favicon",
|
||||
"Code": "http://localhost:49185/favicon.ico",
|
||||
"Define": NumberInt(1)
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '网站
|
|||
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '个人中心地址', 'http://localhost:50852/Admin/Profiles', 1);
|
||||
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '系统设置地址', 'http://localhost:50852/Admin/Index', 1);
|
||||
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '系统通知地址', 'http://localhost:50852/Admin/Notifications', 1);
|
||||
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('测试平台', '网站图标', 'http://localhost:49185/favicon.ico', 1);
|
||||
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('测试平台', 'favicon', 'http://localhost:49185/favicon.ico', 1);
|
||||
|
||||
Delete from Navigations where Application = 2;
|
||||
INSERT into Navigations (ParentId, Name, `Order`, Icon, Url, Category, Application) VALUES (0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 2);
|
||||
|
|
|
@ -158,7 +158,7 @@ Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '网站
|
|||
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '个人中心地址', 'http://localhost:50852/Admin/Profiles', 1);
|
||||
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '系统设置地址', 'http://localhost:50852/Admin/Index', 1);
|
||||
Insert into Dicts (Category, Name, Code, Define) values ('测试平台', '系统通知地址', 'http://localhost:50852/Admin/Notifications', 1);
|
||||
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('测试平台', '网站图标', 'http://localhost:49185/favicon.ico', 1);
|
||||
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('测试平台', 'favicon', 'http://localhost:49185/favicon.ico', 1);
|
||||
|
||||
Delete from Navigations where Application = '2';
|
||||
INSERT into Navigations (ParentId, Name, "order", Icon, Url, Category, Application) VALUES (0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 2);
|
||||
|
|
|
@ -163,7 +163,7 @@ Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '网
|
|||
Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '个人中心地址', 'http://localhost:50852/Admin/Profiles', 1);
|
||||
Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '系统设置地址', 'http://localhost:50852/Admin/Index', 1);
|
||||
Insert into Dicts (Category, [Name], Code, Define) values ('测试平台', '系统通知地址', 'http://localhost:50852/Admin/Notifications', 1);
|
||||
INSERT INTO Dicts (Category, [Name], Code, Define) VALUES ('测试平台', '网站图标', 'http://localhost:49185/favicon.ico', 1);
|
||||
INSERT INTO Dicts (Category, [Name], Code, Define) VALUES ('测试平台', 'favicon', 'http://localhost:49185/favicon.ico', 1);
|
||||
|
||||
Delete from [Navigations] where Application = 2;
|
||||
INSERT into [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], [Application]) VALUES (0, '首页', 10, 'fa fa-fa', '~/Home/Index', '1', 2);
|
||||
|
|
|
@ -170,7 +170,7 @@ Insert Dicts (Category, Name, Code, Define) values (@AppName, N'网站页脚', N
|
|||
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'个人中心地址', N'http://localhost:50852/Admin/Profiles', 1);
|
||||
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'系统设置地址', N'http://localhost:50852/Admin/Index', 1);
|
||||
Insert Dicts (Category, Name, Code, Define) values (@AppName, N'系统通知地址', N'http://localhost:50852/Admin/Notifications', 1);
|
||||
INSERT Dicts (Category, Name, Code, Define) VALUES (@AppName, N'网站图标', N'http://localhost:49185/favicon.ico', 1);
|
||||
INSERT Dicts (Category, Name, Code, Define) VALUES (@AppName, N'favicon', N'http://localhost:49185/favicon.ico', 1);
|
||||
|
||||
-- 菜单
|
||||
DELETE FROM Navigations Where [Application] = @AppId
|
||||
|
|
Binary file not shown.
|
@ -31,7 +31,7 @@ namespace Bootstrap.Admin.Models
|
|||
|
||||
// feat: https://gitee.com/LongbowEnterprise/dashboard/issues?id=I12VKZ
|
||||
// 后台系统网站图标跟随个人中心设置的默认应用站点的展示
|
||||
WebSiteLogo = DictHelper.RetrieveWebLogo(AppId);
|
||||
WebSiteIcon = DictHelper.RetrieveWebIcon(AppId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
namespace Bootstrap.Admin.Models
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// Model 基类
|
||||
/// </summary>
|
||||
public class ModelBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取 网站 logo 小图标
|
||||
/// </summary>
|
||||
public string WebSiteLogo { get; protected set; } = "~/favicon.ico";
|
||||
public string WebSiteIcon { get; protected set; } = "~/favicon.ico";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<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="@Url.Content(Model.WebSiteLogo)" type="image/x-icon" />
|
||||
<link rel="shortcut icon" href="@Url.Content(Model.WebSiteLogo)" type="image/x-icon" />
|
||||
<link rel="icon" href="@Url.Content(Model.WebSiteIcon)" type="image/x-icon" />
|
||||
<link rel="shortcut icon" href="@Url.Content(Model.WebSiteIcon)" type="image/x-icon" />
|
||||
<link rel="apple-touch-icon" href="~/favicon.png"/>
|
||||
<title>@ViewBag.Title</title>
|
||||
@RenderSection("css", false)
|
||||
|
|
|
@ -32,16 +32,16 @@ namespace Bootstrap.DataAccess
|
|||
private static IEnumerable<BootstrapDict> RetrieveProtectedDicts() => RetrieveDicts().Where(d => d.Define == 0 || d.Category == "测试平台");
|
||||
|
||||
/// <summary>
|
||||
/// 获取网站 logo 小图标
|
||||
/// 获取网站 favicon 图标
|
||||
/// </summary>
|
||||
/// <param name="appId"></param>
|
||||
/// <returns></returns>
|
||||
public static string RetrieveWebLogo(string appId)
|
||||
public static string RetrieveWebIcon(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";
|
||||
return ditcs.FirstOrDefault(d => d.Category == platName && d.Name == "favicon")?.Code ?? $"~/favicon.ico";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue