Compare commits
No commits in common. "628e0ad0346c440439bd744a3a10f08283b9932e" and "87caf24dd1865619ace7d8545b583e7ea734579a" have entirely different histories.
628e0ad034
...
87caf24dd1
|
|
@ -970,21 +970,19 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
if (existUserLoginInfo.LastLoginIP != string.Empty)
|
||||
{
|
||||
//设置上次登录的IP
|
||||
await _identityUserRepository.BatchUpdateNoTrackingAsync(x => x.Id == existUserLoginInfo.Id, x => new IdentityUser()
|
||||
{
|
||||
LastLoginIP = iPRegion,
|
||||
LastLoginTime = DateTime.Now
|
||||
|
||||
});
|
||||
|
||||
|
||||
// 与上一次区域不一致
|
||||
if (SplitAndConcatenate(existUserLoginInfo.LastLoginIP) != SplitAndConcatenate(iPRegion))
|
||||
{
|
||||
|
||||
isLoginUncommonly = true;
|
||||
|
||||
//设置上次登录的IP
|
||||
await _identityUserRepository.BatchUpdateNoTrackingAsync(x => x.Id == existUserLoginInfo.Id, x => new IdentityUser()
|
||||
{
|
||||
LastLoginIP = iPRegion,
|
||||
LastLoginTime = DateTime.Now
|
||||
|
||||
});
|
||||
|
||||
if (loginUser != null)
|
||||
{
|
||||
|
|
@ -1020,6 +1018,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
|
||||
|
||||
await _identityUserRepository.BatchUpdateNoTrackingAsync(x => x.Id == loginUser.IdentityUserId, x => new IdentityUser()
|
||||
{
|
||||
LastLoginTime = DateTime.Now,
|
||||
LastLoginIP = _userInfo.IP,
|
||||
});
|
||||
|
||||
|
||||
if (loginUser.Status == 0)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, ActionUserName = loginUser.UserName, OptType = UserOptType.LoginLockedAccount, IsLoginUncommonly = isLoginUncommonly }, true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue