登录修改
parent
34f6292fa7
commit
b7fe79208e
|
@ -996,11 +996,20 @@ namespace IRaCIS.Core.Application.Service
|
|||
loginUser.NeedChangePassWord = true;
|
||||
}
|
||||
|
||||
if (existUserLoginInfo.LastLoginIP != string.Empty)
|
||||
List<UserOptType> userOptTypes = new List<UserOptType>() {
|
||||
UserOptType.Login,
|
||||
UserOptType.AccountOrPasswordError,
|
||||
UserOptType.LoginLockedAccount
|
||||
};
|
||||
|
||||
var lastLoginIPRegion = await _userLogRepository.Where(t => t.ActionIdentityUserId == existUserLoginInfo.Id && userOptTypes.Contains(t.OptType))
|
||||
.OrderByDescending(t => t.CreateTime).Select(t => t.IPRegion).FirstOrDefaultAsync();
|
||||
|
||||
if (lastLoginIPRegion != string.Empty)
|
||||
{
|
||||
// 与上一次区域不一致
|
||||
//if (SplitAndConcatenate(existUserLoginInfo.LastLoginIP) != SplitAndConcatenate(iPRegion))
|
||||
if (existUserLoginInfo.LastLoginIP != iPRegion)
|
||||
if (lastLoginIPRegion != iPRegion)
|
||||
{
|
||||
|
||||
isLoginUncommonly = true;
|
||||
|
|
Loading…
Reference in New Issue