更新JWT
This commit is contained in:
1 parent
bb7162aaf6
commit
3769193696
16 files changed
+224
-141
No files matched your search
@@ -1,23 +1,24 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
|
||||
namespace MAX.Framework.Security;
|
||||
|
||||
/// <summary>
|
||||
/// 在线用户会话信息(单点登录:同一用户仅保留一个有效会话)。
|
||||
/// </summary>
|
||||
/// <summary>持久化登录会话;每次登录拥有独立 jti,不保存完整 JWT。</summary>
|
||||
[Table(Name = "wxxd.auth_login_session")]
|
||||
public class OnlineUserInfo
|
||||
{
|
||||
/// <summary>登录账户(唯一,作为会话键)</summary>
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>用户昵称</summary>
|
||||
public string NickName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>当前有效会话的令牌唯一标识(jti)</summary>
|
||||
public string Jti { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>登录时间(本地时间)</summary>
|
||||
public DateTime LoginTime { get; set; }
|
||||
|
||||
/// <summary>会话过期时间(本地时间,与令牌 exp 一致)</summary>
|
||||
public DateTime ExpiresAt { get; set; }
|
||||
[Column(IsPrimary = true, StringLength = 32)]
|
||||
public string Jti { get; set; } = string.Empty;
|
||||
[Column(StringLength = 255)]
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
[Column(StringLength = 255)]
|
||||
public string NickName { get; set; } = string.Empty;
|
||||
/// <summary>服务端观察到的客户端 IP;反向代理需配置受信任的转发头。</summary>
|
||||
[Column(StringLength = 45)]
|
||||
public string LoginIp { get; set; } = string.Empty;
|
||||
/// <summary>UTC 登录时间。</summary>
|
||||
public DateTime LoginTime { get; set; }
|
||||
/// <summary>UTC 到期时间,与 JWT exp 对齐。</summary>
|
||||
public DateTime ExpiresAt { get; set; }
|
||||
/// <summary>UTC 撤销时间;保留记录供后续面板查询。</summary>
|
||||
public DateTime? RevokedAt { get; set; }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user