using Entity.DbModel.System.SysBaseObject;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Service.Mgr
{
///
/// 当前登录用户
///
//[Scope("SingleInstance")]
public class UserManager
{
//private readonly IHttpContextAccessor _httpContextAccessor;
/////
///// 用户ID
/////
//public long UserId => (_httpContextAccessor.HttpContext?.User.FindFirst(ClaimConst.UserId)?.Value).ToLong();
/////
///// 用户账号
/////
//public string Account => _httpContextAccessor.HttpContext?.User.FindFirst(ClaimConst.Account)?.Value;
/////
///// 真实姓名
/////
//public string RealName => _httpContextAccessor.HttpContext?.User.FindFirst(ClaimConst.RealName)?.Value;
/////
///// 是否超级管理员
/////
//public bool SuperAdmin => _httpContextAccessor.HttpContext?.User.FindFirst(ClaimConst.AccountType)?.Value == ((int)AccountTypeEnum.SuperAdmin).ToString();
/////
///// 是否系统管理员
/////
//public bool SysAdmin => _httpContextAccessor.HttpContext?.User.FindFirst(ClaimConst.AccountType)?.Value == ((int)AccountTypeEnum.SysAdmin).ToString();
//public UserManager(IHttpContextAccessor httpContextAccessor)
//{
// _httpContextAccessor = httpContextAccessor;
//}
///
/// 用户ID
///
public static long UserId;
///
/// 用户账号
///
public static string Account;
///
/// 真实姓名
///
public static string RealName;
///
/// 是否超级管理员
///
public static bool SuperAdmin;
///
/// 是否系统管理员
///
public static bool SysAdmin;
public void SetManagerContent(SysUser user)
{
UserId = user.Id;
Account = user.Account;
RealName = user.RealName;
SuperAdmin = user.RealName == "超级管理员" ? true : false;
SysAdmin = user.RealName == "系统管理员" ? true : false;
}
}
}