You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
BookingHeChuan/Myshipping.Core/Manager/UserManager.cs

45 lines
1.2 KiB
C#

using Furion;
namespace Myshipping.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>
/// 昵称
/// </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();
/// <summary>
/// 租户ID
/// </summary>
public static string TENANT_ID => App.User.FindFirst(ClaimConst.TENANT_ID)?.Value;
/// <summary>
/// 租户名称
/// </summary>
public static string CLAINM_TENANT_NAME => App.User.FindFirst(ClaimConst.CLAINM_TENANT_NAME)?.Value;
}