修改BUG:修正用户未设置默认头像时不显示问题,依赖组件Bootstrap.Security.DataAccess升级到1.4

This commit is contained in:
Argo-Surface 2019-02-01 14:08:47 +08:00
parent fc043c8ffc
commit 34e340d9ee
5 changed files with 5 additions and 13 deletions

View File

@ -16,7 +16,7 @@ namespace Bootstrap.Admin.Models
public HeaderBarModel(IIdentity identity)
{
var user = UserHelper.RetrieveUserByUserName(identity.Name);
Icon = Path.Combine(DictHelper.RetrieveIconFolderPath(), string.IsNullOrEmpty(user.Icon) ? DictHelper.RetrieveDefaultIcon() : user.Icon);
Icon = string.Format("{0}{1}", DictHelper.RetrieveIconFolderPath(), user.Icon);
DisplayName = user.DisplayName;
UserName = user.UserName;
if (!string.IsNullOrEmpty(user.Css)) Theme = user.Css;

View File

@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="1.3.0" />
<PackageReference Include="Bootstrap.Security.DataAccess" Version="1.4.0" />
<PackageReference Include="Longbow.Cache" Version="2.2.3" />
<PackageReference Include="Longbow.Web" Version="2.2.2" />
</ItemGroup>

View File

@ -11,12 +11,12 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="1.3.0" />
<PackageReference Include="Longbow.Data" Version="2.2.3" />
<PackageReference Include="Bootstrap.Security.DataAccess" Version="1.4.0" />
<PackageReference Include="Longbow.Data" Version="2.2.4" />
<PackageReference Include="Longbow.Security.Cryptography" Version="1.3.0" />
<PackageReference Include="Longbow.Web" Version="2.2.2" />
<PackageReference Include="Longbow.Cache" Version="2.2.3" />
<PackageReference Include="Longbow" Version="2.2.3" />
<PackageReference Include="Longbow" Version="2.2.4" />
<PackageReference Include="PetaPoco.Compiled" Version="1.0.1" />
</ItemGroup>

View File

@ -99,8 +99,6 @@ namespace Bootstrap.DataAccess
/// <returns></returns>
public virtual string RetrieveHomeUrl() => (DictHelper.RetrieveDicts().FirstOrDefault(d => d.Name == "前台首页" && d.Category == "网站设置" && d.Define == 0) ?? new BootstrapDict() { Code = "~/Home/Index" }).Code;
public virtual string RetrieveDefaultIcon() => (DictHelper.RetrieveDicts().FirstOrDefault(d => d.Name == "头像文件" && d.Category == "头像地址" && d.Define == 0) ?? new BootstrapDict() { Code = "default.jpg" }).Code;
/// <summary>
///
/// </summary>

View File

@ -109,12 +109,6 @@ namespace Bootstrap.DataAccess
/// <returns></returns>
public static string RetrieveHomeUrl() => DbContextManager.Create<Dict>().RetrieveHomeUrl();
/// <summary>
/// 获得默认的前台首页地址,默认为~/Home/Index
/// </summary>
/// <returns></returns>
public static string RetrieveDefaultIcon() => DbContextManager.Create<Dict>().RetrieveDefaultIcon();
/// <summary>
///
/// </summary>