添加项目文件。
This commit is contained in:
1 parent
6a017c9547
commit
58abbb5b4f
86 files changed
+8729
No files matched your search
@@ -0,0 +1,44 @@
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace StoreHub.Framework.Security;
|
||||
|
||||
/// <summary>
|
||||
/// 当前登录用户访问器:从当前请求的认证票据中读取用户信息。
|
||||
/// </summary>
|
||||
public interface ICurrentUser
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前请求是否已认证
|
||||
/// </summary>
|
||||
bool IsAuthenticated { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前用户ID(未登录为 null)
|
||||
/// </summary>
|
||||
int? Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前登录账户名(未登录为 null)
|
||||
/// </summary>
|
||||
string? UserName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前用户昵称(未登录为 null)
|
||||
/// </summary>
|
||||
string? NickName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前用户的全部声明
|
||||
/// </summary>
|
||||
IEnumerable<Claim> Claims { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定类型的声明值
|
||||
/// </summary>
|
||||
string? GetClaimValue(string claimType);
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定类型的声明值并转换为目标类型;不存在或转换失败返回默认值
|
||||
/// </summary>
|
||||
T? GetClaimValue<T>(string claimType);
|
||||
}
|
||||
Reference in new issue
Block a user