2016-10-24 01:01:29 +08:00
|
|
|
|
using Bootstrap.DataAccess;
|
2017-04-03 15:56:17 +08:00
|
|
|
|
using Bootstrap.Security;
|
2018-06-07 00:45:47 +08:00
|
|
|
|
using System.Security.Principal;
|
2016-10-24 01:01:29 +08:00
|
|
|
|
using System.Web;
|
|
|
|
|
|
|
|
|
|
namespace Bootstrap.Admin.Models
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class HeaderBarModel : ModelBase
|
|
|
|
|
{
|
2018-06-07 00:45:47 +08:00
|
|
|
|
public HeaderBarModel(IIdentity identity)
|
2016-10-24 01:01:29 +08:00
|
|
|
|
{
|
2018-06-07 00:45:47 +08:00
|
|
|
|
var user = BootstrapUser.RetrieveUserByUserName(identity.Name);
|
2016-11-16 17:27:03 +08:00
|
|
|
|
Icon = user.Icon;
|
2016-10-25 12:16:00 +08:00
|
|
|
|
DisplayName = user.DisplayName;
|
2016-11-08 20:37:14 +08:00
|
|
|
|
UserName = user.UserName;
|
2017-06-13 11:34:06 +08:00
|
|
|
|
Css = user.Css;
|
2016-10-24 01:01:29 +08:00
|
|
|
|
}
|
2017-06-13 11:34:06 +08:00
|
|
|
|
public string UserName { get; }
|
2016-10-24 01:01:29 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2017-06-13 11:34:06 +08:00
|
|
|
|
public string DisplayName { get; }
|
2016-10-24 01:01:29 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2016-12-20 13:22:33 +08:00
|
|
|
|
public string HomeUrl { get; set; }
|
2016-11-05 23:15:07 +08:00
|
|
|
|
/// <summary>
|
2016-11-18 10:18:41 +08:00
|
|
|
|
/// 获得/设置 用户头像地址
|
2016-11-15 11:15:38 +08:00
|
|
|
|
/// </summary>
|
2017-06-13 11:34:06 +08:00
|
|
|
|
public string Icon { get; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Css { get; }
|
2016-10-24 01:01:29 +08:00
|
|
|
|
}
|
2016-10-20 17:55:29 +08:00
|
|
|
|
}
|