修改IP
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
a540326031
commit
6b536f4a4f
|
@ -806,12 +806,14 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
//登录成功 清除缓存
|
//登录成功 清除缓存
|
||||||
_cache.Set(cacheKey, 0, TimeSpan.FromMinutes(lockoutMinutes));
|
_cache.Set(cacheKey, 0, TimeSpan.FromMinutes(lockoutMinutes));
|
||||||
|
var ipinfo = _searcher.Search(_userInfo.IP);
|
||||||
|
|
||||||
|
var iPRegion = string.Join('|', ipinfo.Split('|').TakeLast(3));
|
||||||
|
|
||||||
if (loginUser.LastLoginIP != string.Empty)
|
if (loginUser.LastLoginIP != string.Empty)
|
||||||
{
|
{
|
||||||
// 与上一次IP不一致
|
// 与上一次IP不一致
|
||||||
if (loginUser.LastLoginIP != _userInfo.IP)
|
if (loginUser.LastLoginIP != iPRegion)
|
||||||
{
|
{
|
||||||
loginUser.LoginState = 2;
|
loginUser.LoginState = 2;
|
||||||
}
|
}
|
||||||
|
@ -832,9 +834,7 @@ namespace IRaCIS.Application.Services
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
var ipinfo = _searcher.Search(_userInfo.IP);
|
|
||||||
|
|
||||||
var iPRegion = string.Join('|', ipinfo.Split('|').TakeLast(3));
|
|
||||||
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == loginUser.Id, x => new User()
|
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == loginUser.Id, x => new User()
|
||||||
{
|
{
|
||||||
LastLoginIP = iPRegion,
|
LastLoginIP = iPRegion,
|
||||||
|
|
Loading…
Reference in New Issue