2016-10-23 23:35:17 +08:00
|
|
|
|
using Bootstrap.DataAccess;
|
2018-08-13 14:49:54 +08:00
|
|
|
|
using System.Security.Principal;
|
2016-10-23 23:35:17 +08:00
|
|
|
|
|
|
|
|
|
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
|
|
|
|
{
|
2019-01-14 17:31:57 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="identity"></param>
|
2018-08-13 14:49:54 +08:00
|
|
|
|
public HeaderBarModel(IIdentity identity)
|
2016-10-23 23:35:17 +08:00
|
|
|
|
{
|
2019-01-14 17:31:57 +08:00
|
|
|
|
var user = UserHelper.RetrieveUserByUserName(identity.Name);
|
2019-02-01 14:08:47 +08:00
|
|
|
|
Icon = string.Format("{0}{1}", DictHelper.RetrieveIconFolderPath(), user.Icon);
|
2016-10-23 23:35:17 +08:00
|
|
|
|
DisplayName = user.DisplayName;
|
|
|
|
|
UserName = user.UserName;
|
2019-01-14 17:31:57 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(user.Css)) Theme = user.Css;
|
2016-10-23 23:35:17 +08:00
|
|
|
|
}
|
2016-10-20 17:55:29 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2019-01-14 17:31:57 +08:00
|
|
|
|
public string UserName { get; }
|
2016-10-23 23:35:17 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2019-01-14 17:31:57 +08:00
|
|
|
|
public string DisplayName { get; }
|
2016-10-23 23:35:17 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获得/设置 用户头像地址
|
|
|
|
|
/// </summary>
|
2018-05-05 14:41:43 +08:00
|
|
|
|
public string Icon { get; }
|
2016-10-20 17:55:29 +08:00
|
|
|
|
}
|
|
|
|
|
}
|