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