跨域测试

Uat_Study
hang 2022-11-23 18:21:25 +08:00
parent dcf7368ec7
commit f59d1533fc
3 changed files with 9 additions and 7 deletions

View File

@ -23,7 +23,7 @@ namespace IRaCIS.Core.API
} }
[AllowAnonymous] [AllowAnonymous]
[EnableCors] [DisableCors]
public class UploadHub : Hub<IUploadClient> public class UploadHub : Hub<IUploadClient>
{ {

View File

@ -164,15 +164,14 @@ namespace IRaCIS.Core.API
app.UseForwardedHeaders(); app.UseForwardedHeaders();
app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
//响应压缩 //响应压缩
app.UseResponseCompression(); app.UseResponseCompression();
//app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
//不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication. //不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication.
app.UseStaticFiles(); app.UseStaticFiles();
app.UseIRacisHostStaticFileStore(env);
//LogDashboard //LogDashboard
app.UseLogDashboard("/LogDashboard"); app.UseLogDashboard("/LogDashboard");
@ -212,7 +211,10 @@ namespace IRaCIS.Core.API
app.UseRouting(); app.UseRouting();
//app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
app.UseIRacisHostStaticFileStore(env);
app.UseAuthentication(); app.UseAuthentication();

View File

@ -58,7 +58,7 @@ namespace IRaCIS.Core.Application
.Where( t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where( t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)) .Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
.SelectMany(t => t.TrialDocConfirmedUserList) .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 TotalNeedSignSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
? 0 ? 0
@ -73,7 +73,7 @@ namespace IRaCIS.Core.Application
: await _systemDocumentRepository : await _systemDocumentRepository
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)) .Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
.SelectMany(t => t.SystemDocConfirmedUserList) .SelectMany(t => t.SystemDocConfirmedUserList)
.CountAsync(t => t.ConfirmUserId == _userInfo.Id), .CountAsync(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null),
TotalApprovalRequiredCount= TotalApprovalRequiredCount=
_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM ? _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM ?