Compare commits

..

No commits in common. "963fbcb5e8f7c9e575312e2a3cda2c63f8aabef1" and "a055d1c668f381abec683ef48ac656e2ce5a805f" have entirely different histories.

3 changed files with 8 additions and 22 deletions

View File

@ -37,12 +37,7 @@ 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; }
public UserTypeEnum UserTypeEnum { get; set; }
/// <summary>
/// 上一次修改密码的时间

View File

@ -714,11 +714,11 @@ namespace IRaCIS.Application.Services
//登录成功 清除缓存
_cache.Set(cacheKey, 0, TimeSpan.FromMinutes(lockoutMinutes));
if (loginUser.LastLoginIP != string.Empty)
var lastLoginLog = await _userLogRepository.Where(x => x.LoginUserId == loginUser.Id).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync();
if (lastLoginLog!=null)
{
// 与上一次IP不一致
if (loginUser.LastLoginIP != _userInfo.IP)
if (lastLoginLog.IP != _userInfo.IP)
{
loginUser.LoginState = 2;
}
@ -740,17 +740,13 @@ namespace IRaCIS.Application.Services
}
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == loginUser.Id, x => new User()
{
LastLoginIP = _userInfo.IP
});
// 登录 清除缓存
//_cache.Remove(userLoginReturnModel.BasicInfo.Id.ToString());
var userId = loginUser.Id;
// 登录 清除缓存
//_cache.Remove(userLoginReturnModel.BasicInfo.Id.ToString());
var userId = loginUser.Id;
await _cache.SetAsync($"{userId.ToString()}_Online", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));

View File

@ -83,11 +83,6 @@ 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; }