From f59d1533fca941dc59864221a0da8e2f1b511897 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 23 Nov 2022 18:21:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=A8=E5=9F=9F=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/SignalRHub/UploadHub.cs | 2 +- IRaCIS.Core.API/Startup.cs | 10 ++++++---- .../Service/TrialSiteUser/PersonalWorkstation.cs | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/IRaCIS.Core.API/SignalRHub/UploadHub.cs b/IRaCIS.Core.API/SignalRHub/UploadHub.cs index 8df85b4e..7fae50d7 100644 --- a/IRaCIS.Core.API/SignalRHub/UploadHub.cs +++ b/IRaCIS.Core.API/SignalRHub/UploadHub.cs @@ -23,7 +23,7 @@ namespace IRaCIS.Core.API } [AllowAnonymous] - [EnableCors] + [DisableCors] public class UploadHub : Hub { diff --git a/IRaCIS.Core.API/Startup.cs b/IRaCIS.Core.API/Startup.cs index 97c96b37..3b185cb4 100644 --- a/IRaCIS.Core.API/Startup.cs +++ b/IRaCIS.Core.API/Startup.cs @@ -164,15 +164,14 @@ namespace IRaCIS.Core.API app.UseForwardedHeaders(); - app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); - //响应压缩 app.UseResponseCompression(); + //app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); + //不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication. app.UseStaticFiles(); - app.UseIRacisHostStaticFileStore(env); //LogDashboard app.UseLogDashboard("/LogDashboard"); @@ -212,7 +211,10 @@ namespace IRaCIS.Core.API app.UseRouting(); - //app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); + app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); + + app.UseIRacisHostStaticFileStore(env); + app.UseAuthentication(); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index 30430c6d..b35e94be 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -58,7 +58,7 @@ namespace IRaCIS.Core.Application .Where( t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)) .SelectMany(t => t.TrialDocConfirmedUserList) - .CountAsync(t => t.ConfirmUserId == _userInfo.Id), + .CountAsync(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime !=null), TotalNeedSignSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin ? 0 @@ -73,7 +73,7 @@ namespace IRaCIS.Core.Application : await _systemDocumentRepository .Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)) .SelectMany(t => t.SystemDocConfirmedUserList) - .CountAsync(t => t.ConfirmUserId == _userInfo.Id), + .CountAsync(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null), TotalApprovalRequiredCount= _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM ?