Compare commits
2 Commits
87caf24dd1
...
628e0ad034
| Author | SHA1 | Date |
|---|---|---|
|
|
628e0ad034 | |
|
|
2f3f639918 |
|
|
@ -970,19 +970,21 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
if (existUserLoginInfo.LastLoginIP != string.Empty)
|
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))
|
if (SplitAndConcatenate(existUserLoginInfo.LastLoginIP) != SplitAndConcatenate(iPRegion))
|
||||||
{
|
{
|
||||||
|
|
||||||
isLoginUncommonly = true;
|
isLoginUncommonly = true;
|
||||||
|
|
||||||
//设置上次登录的IP
|
|
||||||
await _identityUserRepository.BatchUpdateNoTrackingAsync(x => x.Id == existUserLoginInfo.Id, x => new IdentityUser()
|
|
||||||
{
|
|
||||||
LastLoginIP = iPRegion,
|
|
||||||
LastLoginTime = DateTime.Now
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
if (loginUser != null)
|
if (loginUser != null)
|
||||||
{
|
{
|
||||||
|
|
@ -1018,13 +1020,6 @@ 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)
|
if (loginUser.Status == 0)
|
||||||
{
|
{
|
||||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, ActionUserName = loginUser.UserName, OptType = UserOptType.LoginLockedAccount, IsLoginUncommonly = isLoginUncommonly }, true);
|
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