🍒 fix(auth): 调整token版本更新时机
This commit is contained in:
parent
1a05dbe0fa
commit
a6fd3a1408
@ -229,6 +229,7 @@ public class SysAuthService : IDynamicApiController, ITransient
|
||||
await App.GetRequiredService<SysOnlineUserService>().SingleLogin(user.Id, loginMode);
|
||||
|
||||
// 生成Token令牌
|
||||
user.TokenVersion += 1;
|
||||
var tokenExpire = await _sysConfigService.GetTokenExpire();
|
||||
var accessToken = JWTEncryption.Encrypt(new Dictionary<string, object>
|
||||
{
|
||||
@ -263,7 +264,6 @@ public class SysAuthService : IDynamicApiController, ITransient
|
||||
// ke.global.setAllHeader('Authorization', 'Bearer ' + ke.response.headers['access-token']);
|
||||
|
||||
// 更新用户登录信息
|
||||
user.TokenVersion += 1;
|
||||
user.LastLoginIp = _httpContextAccessor.HttpContext.GetRemoteIpAddressToIPv4(true);
|
||||
(user.LastLoginAddress, double? longitude, double? latitude) = CommonHelper.GetIpAddress(user.LastLoginIp);
|
||||
user.LastLoginTime = DateTime.Now;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user