From 5d7a083f4a1cba08de9b9367b033afe5172b3f39 Mon Sep 17 00:00:00 2001 From: hang <87227557@qq.com> Date: Fri, 30 Jan 2026 22:37:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8C=85?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRC.Core.SCP/Service/CStoreSCPService.cs | 26 +++++++++++++++--------- irc_api.drone.yml | 19 ++++------------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/IRC.Core.SCP/Service/CStoreSCPService.cs b/IRC.Core.SCP/Service/CStoreSCPService.cs index 4ffb31d38..820e5c7f8 100644 --- a/IRC.Core.SCP/Service/CStoreSCPService.cs +++ b/IRC.Core.SCP/Service/CStoreSCPService.cs @@ -205,19 +205,25 @@ namespace IRaCIS.Core.SCP.Service var _SCPImageUploadRepository = _serviceProvider.GetService>(); - _upload.EndTime = DateTime.Now; - _upload.StudyCount = _ImageUploadList.Count; - _upload.TrialId = _trialId; - _upload.TrialSiteId = _trialSiteId; - - _upload.UploadJsonStr = (new SCPImageLog() { UploadList = _ImageUploadList }).ToJsonStr(); - - //可能是测试echo 导致记录了 - if (_upload.FileCount > 0) + //有时候没有建立连接会走关闭通过日志发现 + if (_upload != null) { + _upload.EndTime = DateTime.Now; + _upload.StudyCount = _ImageUploadList.Count; + _upload.TrialId = _trialId; + _upload.TrialSiteId = _trialSiteId; + + _upload.UploadJsonStr = (new SCPImageLog() { UploadList = _ImageUploadList }).ToJsonStr(); + //可能是测试echo 导致记录了 - await _SCPImageUploadRepository.AddAsync(_upload, true); + if (_upload.FileCount > 0) + { + //可能是测试echo 导致记录了 + await _SCPImageUploadRepository.AddAsync(_upload, true); + } } + + } diff --git a/irc_api.drone.yml b/irc_api.drone.yml index 3532380ce..785ee716c 100644 --- a/irc_api.drone.yml +++ b/irc_api.drone.yml @@ -18,8 +18,7 @@ server: steps: - name: build-uat-irc commands: - - cd /opt/1panel/xc-deploy/Uat_IRC/devops-build-publish/Uat-To-Uat - - sh uat-branch-latest-build-image-publish.sh v${DRONE_BUILD_NUMBER} + - bash /opt/1panel/xc-deploy-new/Uat_IRC/devops-publish/uat-branch-publish.sh trigger: branch: @@ -46,12 +45,7 @@ server: steps: - name: publish-test-irc commands: - - cd /opt/1panel/xc-deploy/Test_IRC/devops-build-publish;sh test-irc-update-or-create-stack.sh v${DRONE_BUILD_NUMBER} - -- name: publish-test-irc-scp - commands: - - cd /opt/1panel/xc-deploy/Test_IRC_SCP/devops-build-publish;sh pull-build-test-irc-scp-image.sh v${DRONE_BUILD_NUMBER} - - cd /opt/1panel/xc-deploy/Test_IRC_SCP ;sh update-image-if-need-then-pull-aliyun.sh v${DRONE_BUILD_NUMBER} + - bash /opt/1panel/xc-deploy-new/Test_IRC_Swarm/devops-publish/test-branch-publish.sh trigger: branch: @@ -108,13 +102,8 @@ server: steps: - name: publish-test-hir commands: - - cd /opt/1panel/xc-deploy/Test_HIR/devops-build-publish;sh pull-build-test-hir-image.sh v${DRONE_BUILD_NUMBER} - - cd /opt/1panel/xc-deploy/Test_HIR ; sh update-image-if-need-then-pull-aliyun.sh v${DRONE_BUILD_NUMBER} - -- name: publish-test-hir-scp - commands: - - cd /opt/1panel/xc-deploy/Test_HIR_SCP/devops-build-publish;sh pull-build-test-hir-scp-image.sh v${DRONE_BUILD_NUMBER} - - cd /opt/1panel/xc-deploy/Test_HIR_SCP ;sh update-image-if-need-then-pull-aliyun.sh v${DRONE_BUILD_NUMBER} + - bash /opt/1panel/xc-deploy-new/Test_HIR/devops-publish/test-branch-publish.sh + trigger: branch: - Test_HIR From dd8e244e64f438516d7c9e247b0bc2a231df91e9 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 2 Feb 2026 10:25:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AF=86=E7=A0=81=E8=BF=9E=E7=BB=AD?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=AC=A1=E6=95=B0=E5=88=A4=E6=96=AD=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserService.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 0c0f54c33..82b77e306 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -1000,14 +1000,6 @@ namespace IRaCIS.Core.Application.Service var userLog = new UserLog(); - if (failCount >= maxFailures) - { - await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = userName, LoginPassword = password, OptType = UserOptType.TempLockLogin }, true); - - //$"密码连续错误{maxFailures}次,当前账号已被限制登录,请等待 {lockoutMinutes} 分钟后再试。" - throw new BusinessValidationFailedException(_localizer["User_ErrorLimit", maxFailures, lockoutMinutes]); - } - var userLoginReturnModel = new IRCLoginReturnDTO(); @@ -1019,7 +1011,7 @@ namespace IRaCIS.Core.Application.Service var isLoginUncommonly = false; - #region //登录用户是系统用户的时候,就要要记录异地登录 + #region 登录用户是系统用户的时候,就要要记录异地登录 //账号在系统存在 if (isExistAccount || loginUser != null) @@ -1093,6 +1085,14 @@ namespace IRaCIS.Core.Application.Service //错误次数累加 failCount++; + if (failCount >= maxFailures) + { + await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = userName, LoginPassword = password, OptType = UserOptType.TempLockLogin }, true); + + //$"密码连续错误{maxFailures}次,当前账号已被限制登录,请等待 {lockoutMinutes} 分钟后再试。" + throw new BusinessValidationFailedException(_localizer["User_ErrorLimit", maxFailures, lockoutMinutes]); + } + await _fusionCache.SetAsync(cacheKey, failCount, TimeSpan.FromMinutes(lockoutMinutes)); await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = userName, LoginPassword = password, OptType = UserOptType.AccountOrPasswordError, IsLoginUncommonly = isLoginUncommonly }, true);