BootstrapAdmin/Bootstrap.Admin/Models/HeaderBarModel.cs

29 lines
820 B
C#
Raw Normal View History

2018-10-19 23:09:52 +08:00
using Bootstrap.DataAccess;
2018-06-07 00:45:47 +08:00
using System.Security.Principal;
namespace Bootstrap.Admin.Models
{
/// <summary>
///
/// </summary>
public class HeaderBarModel : ModelBase
{
2018-06-07 00:45:47 +08:00
public HeaderBarModel(IIdentity identity)
{
2018-10-19 23:09:52 +08:00
var user = UserHelper.RetrieveUserByUserName(identity.Name);
Icon = user.Icon;
DisplayName = user.DisplayName;
UserName = user.UserName;
if (!string.IsNullOrEmpty(user.Css)) Theme = user.Css;
}
public string UserName { get; }
/// <summary>
///
/// </summary>
public string DisplayName { get; }
/// <summary>
/// 获得/设置 用户头像地址
/// </summary>
public string Icon { get; }
}
2016-10-20 17:55:29 +08:00
}