using YBEE.EQM.Core;
namespace YBEE.EQM.Application;
///
/// 当前用户
///
public class CurrentSysUserInfo
{
///
/// 用户ID
///
public static int SysUserId
{
get
{
if (int.TryParse(App.User.FindFirst(ClaimConst.CLAINM_USERID)?.Value, out int uid))
{
return uid;
}
return 0;
}
}
///
/// 机构ID
///
public static short SysOrgId
{
get
{
if (short.TryParse(App.User.FindFirst(ClaimConst.CLAINM_ORGID)?.Value, out short oid))
{
return oid;
}
return 0;
}
}
///
/// 机构名称
///
public static string SysOrgName => App.User.FindFirst(ClaimConst.CLAINM_ORGNAME)?.Value;
///
/// 账号
///
public static string Account => App.User.FindFirst(ClaimConst.CLAINM_ACCOUNT)?.Value;
///
/// 名称
///
public static string Name => App.User.FindFirst(ClaimConst.CLAINM_NAME)?.Value;
///
/// 是否超级管理员
///
public static bool IsSuperAdmin
{
get
{
if (bool.TryParse(App.User.FindFirst(ClaimConst.CLAINM_SUPERADMIN)?.Value ?? "False", out bool isSuperAdmin))
{
return isSuperAdmin;
}
return false;
}
}
}