增加进度

Uat_Study
hang 2022-08-05 13:54:44 +08:00
parent f06f32121e
commit 1fa40fd9af
2 changed files with 20 additions and 1 deletions

View File

@ -12,6 +12,7 @@ namespace IRaCIS.Core.API
//[Authorize]
[AllowAnonymous]
public class UploadHub : Hub<IUploadClient>
{
//private IEasyCachingProvider _provider { get; }

View File

@ -149,6 +149,22 @@ namespace IRaCIS.Core.API
// 实时应用
services.AddSignalR();
////设置跨域访问
//services.AddCors(options =>
//{
// //hub使用
// options.AddPolicy("any", builder =>
// {
// builder
// .AllowAnyMethod()
// .AllowAnyHeader()
// .AllowAnyOrigin()
// .DisallowCredentials();
// });
// //公开使用
//});
//services.AddSingleton<IImportResultFilter, ImportResultFilteTest>();
}
@ -212,9 +228,11 @@ namespace IRaCIS.Core.API
//文件伺服 必须带Token 访问
//app.UseIRacisHostStaticFileStore(env);
app.UseCors();
app.UseEndpoints(endpoints =>
{
endpoints.MapHub<UploadHub>("/UploadHub");
endpoints.MapHub<UploadHub>("/UploadHub" ).RequireCors(t=>t.WithOrigins(new string[] {"null"}).AllowAnyMethod().AllowAnyHeader().AllowCredentials());
endpoints.MapControllers();
});