Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
4552a24caa
|
@ -37,6 +37,11 @@ namespace IRaCIS.Application.Contracts
|
|||
public string RealName { get; set; } = string.Empty;
|
||||
public int Sex { get; set; } // 1-男 2-女
|
||||
|
||||
/// <summary>
|
||||
/// LastLoginIP
|
||||
/// </summary>
|
||||
public string LastLoginIP { get; set; } = string.Empty;
|
||||
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -714,11 +714,11 @@ namespace IRaCIS.Application.Services
|
|||
//登录成功 清除缓存
|
||||
_cache.Set(cacheKey, 0, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
|
||||
var lastLoginLog = await _userLogRepository.Where(x => x.LoginUserId == loginUser.Id).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync();
|
||||
if (lastLoginLog!=null)
|
||||
|
||||
if (loginUser.LastLoginIP != string.Empty)
|
||||
{
|
||||
// 与上一次IP不一致
|
||||
if (lastLoginLog.IP != _userInfo.IP)
|
||||
if (loginUser.LastLoginIP != _userInfo.IP)
|
||||
{
|
||||
loginUser.LoginState = 2;
|
||||
}
|
||||
|
@ -740,7 +740,11 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
}
|
||||
|
||||
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == loginUser.Id, x => new User()
|
||||
{
|
||||
LastLoginIP = _userInfo.IP
|
||||
|
||||
});
|
||||
|
||||
|
||||
// 登录 清除缓存
|
||||
|
|
|
@ -83,6 +83,11 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// </summary>
|
||||
public DateTime? LastChangePassWordTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LastLoginIP
|
||||
/// </summary>
|
||||
public string LastLoginIP { get; set; } = string.Empty;
|
||||
|
||||
//医生生成账号后,会有值
|
||||
public Guid? DoctorId { get; set; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue