BootstrapAdmin/Bootstrap.Admin/Models/HeaderBarModel.cs

39 lines
995 B
C#
Raw Normal View History

2016-10-23 23:35:17 +08:00
using Bootstrap.DataAccess;
using Bootstrap.Security;
using System.Security.Principal;
2016-10-23 23:35:17 +08:00
using System.Web;
namespace Bootstrap.Admin.Models
2016-10-20 17:55:29 +08:00
{
/// <summary>
///
/// </summary>
2016-10-23 23:35:17 +08:00
public class HeaderBarModel : ModelBase
2016-10-20 17:55:29 +08:00
{
public HeaderBarModel(IIdentity identity)
2016-10-23 23:35:17 +08:00
{
var user = BootstrapUser.RetrieveUserByUserName(identity.Name);
2016-10-23 23:35:17 +08:00
Icon = user.Icon;
DisplayName = user.DisplayName;
UserName = user.UserName;
Css = user.Css;
2016-10-23 23:35:17 +08:00
}
public string UserName { get; }
2016-10-20 17:55:29 +08:00
/// <summary>
///
/// </summary>
public string DisplayName { get; }
2016-10-23 23:35:17 +08:00
/// <summary>
///
/// </summary>
public string HomeUrl { get; set; }
/// <summary>
/// 获得/设置 用户头像地址
/// </summary>
public string Icon { get; }
/// <summary>
///
/// </summary>
public string Css { get; }
2016-10-20 17:55:29 +08:00
}
}