using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Wood.Util.JwtAuthorization
{
///
/// jwt信息
///
public class JwtUserInfo
{
///
/// 用户id
///
public long UserId { get; set; } = 0;
///
/// 租户
///
public long TenantId { get; set; } = 0;
///
/// 账号
///
public string? UserName { get; set; }
///
/// 姓名
///
public string? RealName { get; set; }
///
/// 姓名
///
public string? NickName { get; set; }
///
/// 机构id
///
public long OrgId { get; set; }
///
/// 用户类型
/// 9999 超级管理员
/// 991 租管
/// 9 管理员
/// 0 用户
/// AccountTypeEnum 对应的 int值
///
public int AccountType { get; set; }
///
/// 是否管理员
///
public bool IsAdmin
{
get
{
return AccountType == 9|| IsTenantAdmin|| IsSuperAdmin;
}
}
///
/// 是否租户管理员
///
public bool IsTenantAdmin
{
get
{
return AccountType == 991|| IsSuperAdmin;
}
}
///
/// 是否超级管理员
///
public bool IsSuperAdmin
{
get
{
return AccountType == 9999;
}
}
public string CacheKey
{
get
{
return UserId + "-" + TenantId;
}
}
}
}