//
namespace SafeCampus.System;
///
/// 当前登录用户信息
///
public class UserManager
{
///
/// 当前用户Id
///
public static long UserId
{
get
{
return (App.User?.FindFirst(ClaimConst.USER_ID)?.Value).ToLong();
}
}
///
/// 当前用户账号
///
public static string UserAccount
{
get
{
return App.User?.FindFirst(ClaimConst.ACCOUNT)?.Value;
}
}
///
/// 当前用户昵称
///
public static string Name
{
get
{
return App.User?.FindFirst(ClaimConst.NAME)?.Value;
}
}
///
/// 是否超级管理员
///
public static bool SuperAdmin
{
get
{
return (App.User?.FindFirst(ClaimConst.IS_SUPER_ADMIN)?.Value).ToBoolean();
}
}
///
/// 机构ID
///
public static long OrgId
{
get
{
return (App.User?.FindFirst(ClaimConst.ORG_ID)?.Value).ToLong();
}
}
public static long? TenantId
{
get
{
//如果有租户ID则返回租户ID,否则返回null
return (App.User?.FindFirst(ClaimConst.TENANT_ID)?.Value).ToLong();
}
}
}