|
|
|
@@ -407,7 +407,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
|
|
|
|
|
await VerifyUserPwdAsync(identityUserId, newPwd);
|
|
|
|
|
|
|
|
|
|
var success = await _identityUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == identityUserId, u => new IdentityUser()
|
|
|
|
|
await _identityUserRepository.UpdatePartialFromQueryAsync(t => t.Id == identityUserId, u => new IdentityUser()
|
|
|
|
|
{
|
|
|
|
|
Password = newPwd,
|
|
|
|
|
IsFirstAdd = false
|
|
|
|
@@ -416,7 +416,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = identityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = identityUserId, OptType = UserOptType.LoginModifyPassword }, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResponseOutput.Result(success);
|
|
|
|
|
return ResponseOutput.Ok();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -437,7 +437,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
|
|
|
|
|
await VerifyUserNameAsync(_userInfo.IdentityUserId, editPwModel.NewUserName);
|
|
|
|
|
|
|
|
|
|
await _identityUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == _userInfo.IdentityUserId, u => new IdentityUser()
|
|
|
|
|
await _identityUserRepository.UpdatePartialFromQueryAsync(t => t.Id == _userInfo.IdentityUserId, u => new IdentityUser()
|
|
|
|
|
{
|
|
|
|
|
UserName = editPwModel.NewUserName,
|
|
|
|
|
});
|
|
|
|
@@ -916,7 +916,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
.WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate)
|
|
|
|
|
.WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate)
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginUserName), t => t.ActionUserName.Contains(inQuery.LoginUserName!))
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.LoginFaildName.Contains(inQuery.LoginFaildName!))
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.ActionUserName.Contains(inQuery.LoginFaildName!))
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP!))
|
|
|
|
|
.WhereIf(inQuery.LoginUserTypeEnum != null, t => t.CreateUserRole.UserTypeEnum == inQuery.LoginUserTypeEnum)
|
|
|
|
|
.WhereIf(inQuery.UserTypeId != null, t => t.CreateUserRole.UserTypeId == inQuery.UserTypeId)
|
|
|
|
@@ -984,7 +984,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
|
|
|
|
|
if (failCount >= maxFailures)
|
|
|
|
|
{
|
|
|
|
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginFaildName = userName, LoginPassword = password, OptType = UserOptType.AccountLocked }, true);
|
|
|
|
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = userName, LoginPassword = password, OptType = UserOptType.AccountLocked }, true);
|
|
|
|
|
|
|
|
|
|
//$"密码连续错误{maxFailures}次,当前账号已被限制登录,请等待 {lockoutMinutes} 分钟后再试。"
|
|
|
|
|
throw new BusinessValidationFailedException(_localizer["User_ErrorLimit", maxFailures, lockoutMinutes]);
|
|
|
|
@@ -1004,7 +1004,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
|
|
|
|
|
var errorPwdUserId = await _identityUserRepository.Where(u => u.UserName == userName).Select(t => t.Id).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = userName, LoginFaildName = userName, LoginPassword = password, OptType = UserOptType.AccountOrPasswordError }, true);
|
|
|
|
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = userName, LoginPassword = password, OptType = UserOptType.AccountOrPasswordError }, true);
|
|
|
|
|
|
|
|
|
|
return ResponseOutput.NotOk(_localizer["User_CheckNameOrPw"], new IRCLoginReturnDTO());
|
|
|
|
|
|
|
|
|
@@ -1012,7 +1012,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
|
|
|
|
|
if (loginUser.Status == 0)
|
|
|
|
|
{
|
|
|
|
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, LoginFaildName = userName, OptType = UserOptType.LoginLockedAccount }, true);
|
|
|
|
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, ActionUserName = userName, OptType = UserOptType.LoginLockedAccount }, true);
|
|
|
|
|
|
|
|
|
|
//---该用户已经被禁用。
|
|
|
|
|
return ResponseOutput.NotOk(_localizer["User_Disabled"], new IRCLoginReturnDTO());
|
|
|
|
@@ -1136,7 +1136,7 @@ namespace IRaCIS.Core.Application.Service
|
|
|
|
|
UserTypeShortName = t.UserTypeRole.UserTypeShortName,
|
|
|
|
|
}).FirstOrDefaultAsync();
|
|
|
|
|
|
|
|
|
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = userTokenInfo.IdentityUserId, ActionUserName = $"{userTokenInfo.UserName } ({userTokenInfo.UserTypeShortName})", OptType = UserOptType.LoginSelectRole }, true);
|
|
|
|
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = userTokenInfo.IdentityUserId, ActionUserName = $"{userTokenInfo.UserName}", ActionUserType=userTokenInfo.UserTypeShortName ,OptType = UserOptType.LoginSelectRole }, true);
|
|
|
|
|
|
|
|
|
|
if (userTokenInfo != null)
|
|
|
|
|
{
|
|
|
|
|