打开后端正式环境验证
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
0ba439e5bd
commit
4b15bcdc55
|
@ -100,6 +100,8 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
//var dbUser = (await _userRepository.FirstOrDefaultAsync(t => t.Id == userId)).IfNullThrowException();
|
//var dbUser = (await _userRepository.FirstOrDefaultAsync(t => t.Id == userId)).IfNullThrowException();
|
||||||
|
|
||||||
|
if (_verifyConfig.CurrentValue.OpenUserComplexPassword)
|
||||||
|
{
|
||||||
if (oldPwd != null && oldPwd == newPwd)
|
if (oldPwd != null && oldPwd == newPwd)
|
||||||
{
|
{
|
||||||
//---新密码与旧密码相同。
|
//---新密码与旧密码相同。
|
||||||
|
@ -122,10 +124,14 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
var passWordList = await _userPassWordLogRepository.Where(x => x.UserId == userId).OrderByDescending(x => x.CreateTime).Take(2).ToListAsync();
|
var passWordList = await _userPassWordLogRepository.Where(x => x.UserId == userId).OrderByDescending(x => x.CreateTime).Take(2).ToListAsync();
|
||||||
|
|
||||||
if (passWordList.Any(x => x.PassWord == newPwd))
|
if (passWordList.Any(x => x.PassWord == newPwd))
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["User_PassWordRepeat"]);
|
throw new BusinessValidationFailedException(_localizer["User_PassWordRepeat"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (oldPwd != null)
|
if (oldPwd != null)
|
||||||
{
|
{
|
||||||
await _userPassWordLogRepository.AddAsync(new UserPassWordLog()
|
await _userPassWordLogRepository.AddAsync(new UserPassWordLog()
|
||||||
|
@ -137,7 +143,6 @@ namespace IRaCIS.Application.Services
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == userId, x => new User()
|
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == userId, x => new User()
|
||||||
{
|
{
|
||||||
LastChangePassWordTime = DateTime.Now,
|
LastChangePassWordTime = DateTime.Now,
|
||||||
|
@ -145,7 +150,6 @@ namespace IRaCIS.Application.Services
|
||||||
await _userPassWordLogRepository.SaveChangesAsync();
|
await _userPassWordLogRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
||||||
await Task.CompletedTask;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue