2018-09-07 16:11:18 +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
|
|
|
|
|
|
|
|
|
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;
|
2018-09-07 16:11:18 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(user.Css)) Theme = 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>
|
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; }
|
2016-10-24 01:01:29 +08:00
|
|
|
|
}
|
2016-10-20 17:55:29 +08:00
|
|
|
|
}
|