😎增加用户表版本号字段
This commit is contained in:
parent
1ee4a276e8
commit
dc70be51f8
@ -65,4 +65,9 @@ public class ClaimConst
|
||||
/// 登录模式PC、APP
|
||||
/// </summary>
|
||||
public const string LoginMode = "LoginMode";
|
||||
|
||||
/// <summary>
|
||||
/// Token版本号
|
||||
/// </summary>
|
||||
public const string TokenVersion = "TokenVersion";
|
||||
}
|
||||
@ -313,6 +313,12 @@ public partial class SysUser : EntityTenant
|
||||
[MaxLength(512)]
|
||||
public string? Signature { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Token版本号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "Token版本号")]
|
||||
public int TokenVersion { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 最新密码修改时间
|
||||
/// </summary>
|
||||
|
||||
@ -229,7 +229,7 @@ public class SysAuthService : IDynamicApiController, ITransient
|
||||
{ ClaimConst.OrgId, user.OrgId },
|
||||
{ ClaimConst.OrgName, user.SysOrg?.Name },
|
||||
{ ClaimConst.OrgType, user.SysOrg?.Type },
|
||||
{ ClaimConst.LoginMode, loginMode },
|
||||
{ ClaimConst.TokenVersion, user.TokenVersion },
|
||||
}, tokenExpire);
|
||||
|
||||
// 生成刷新Token令牌
|
||||
|
||||
@ -46,6 +46,8 @@ namespace Admin.NET.Web.Core
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证Token版本号
|
||||
|
||||
var sysConfigService = serviceScope.ServiceProvider.GetRequiredService<SysConfigService>();
|
||||
var tokenExpire = await sysConfigService.GetTokenExpire();
|
||||
var refreshTokenExpire = await sysConfigService.GetRefreshTokenExpire();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user