You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB


using Furion;
namespace GDZZ.Core;
/// <summary>
/// 用户管理
/// </summary>
public static class UserManager
{
/// <summary>
/// 用户id
/// </summary>
public static long UserId => long.Parse(App.User.FindFirst(ClaimConst.CLAINM_USERID)?.Value);
/// <summary>
/// 账号
/// </summary>
public static string Account => App.User.FindFirst(ClaimConst.CLAINM_ACCOUNT)?.Value;
/// <summary>
/// 租户ID
/// </summary>
public static string TenantID => App.User.FindFirst(ClaimConst.TENANT_ID)?.Value;
/// <summary>
/// 昵称
/// </summary>
public static string Name => App.User.FindFirst(ClaimConst.CLAINM_NAME)?.Value;
/// <summary>
/// 是否超级管理员
/// </summary>
public static bool IsSuperAdmin => App.User.FindFirst(ClaimConst.CLAINM_SUPERADMIN)?.Value == ((int)AdminType.SuperAdmin).ToString();
/// <summary>
/// 是否租户管理员
/// </summary>
public static bool IsTenantAdmin => App.User.FindFirst(ClaimConst.CLAINM_SUPERADMIN)?.Value == ((int)AdminType.Admin).ToString();
}