Uat_Study
hang 2022-08-05 15:34:49 +08:00
parent 9b7442278f
commit ac7da8dede
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
using EasyCaching.Core;
using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
@ -15,6 +16,7 @@ namespace IRaCIS.Core.API
//[Authorize]
[AllowAnonymous]
[DisableCors]
public class UploadHub : Hub<IUploadClient>
{

View File

@ -228,11 +228,11 @@ namespace IRaCIS.Core.API
//文件伺服 必须带Token 访问
//app.UseIRacisHostStaticFileStore(env);
app.UseCors(t => t.WithOrigins(new string[] { "null" }).AllowAnyMethod().AllowAnyHeader().AllowCredentials());
//app.UseCors(t => t.WithOrigins(new string[] { "null" }).AllowAnyMethod().AllowAnyHeader().AllowCredentials());
app.UseEndpoints(endpoints =>
{
endpoints.MapHub<UploadHub>("/UploadHub" ).RequireCors(t=>t.WithOrigins(new string[] {"null"}).AllowAnyMethod().AllowAnyHeader().AllowCredentials());
endpoints.MapHub<UploadHub>("/UploadHub" )/*.RequireCors(t=>t.WithOrigins(new string[] {"null"}).AllowAnyMethod().AllowAnyHeader().AllowCredentials())*/;
endpoints.MapControllers();
});