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.

66 lines
1.8 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 long TENANT_ID => long.Parse(App.User.FindFirst(ClaimConst.TENANT_ID)?.Value);
/// <summary>
/// 租户名称
/// </summary>
public static string TENANT_NAME => App.User.FindFirst(ClaimConst.TENANT_NAME)?.Value;
/// <summary>
/// 大简云userid
/// </summary>
public static string DjyUserId => App.User.FindFirst(ClaimConst.DjyUserId)?.Value;
/// <summary>
/// 电话
/// </summary>
public static string TEl => App.User.FindFirst(ClaimConst.Tel)?.Value;
/// <summary>
/// 手机
/// </summary>
public static string Phone => App.User.FindFirst(ClaimConst.Phone)?.Value;
/// <summary>
/// 邮箱
/// </summary>
public static string Email => App.User.FindFirst(ClaimConst.Email)?.Value;
}