增加进度
parent
f06f32121e
commit
1fa40fd9af
|
@ -12,6 +12,7 @@ namespace IRaCIS.Core.API
|
||||||
|
|
||||||
|
|
||||||
//[Authorize]
|
//[Authorize]
|
||||||
|
[AllowAnonymous]
|
||||||
public class UploadHub : Hub<IUploadClient>
|
public class UploadHub : Hub<IUploadClient>
|
||||||
{
|
{
|
||||||
//private IEasyCachingProvider _provider { get; }
|
//private IEasyCachingProvider _provider { get; }
|
||||||
|
|
|
@ -149,6 +149,22 @@ namespace IRaCIS.Core.API
|
||||||
// 实时应用
|
// 实时应用
|
||||||
services.AddSignalR();
|
services.AddSignalR();
|
||||||
|
|
||||||
|
////设置跨域访问
|
||||||
|
//services.AddCors(options =>
|
||||||
|
//{
|
||||||
|
// //hub使用
|
||||||
|
// options.AddPolicy("any", builder =>
|
||||||
|
// {
|
||||||
|
// builder
|
||||||
|
// .AllowAnyMethod()
|
||||||
|
// .AllowAnyHeader()
|
||||||
|
// .AllowAnyOrigin()
|
||||||
|
// .DisallowCredentials();
|
||||||
|
// });
|
||||||
|
// //公开使用
|
||||||
|
|
||||||
|
//});
|
||||||
|
|
||||||
//services.AddSingleton<IImportResultFilter, ImportResultFilteTest>();
|
//services.AddSingleton<IImportResultFilter, ImportResultFilteTest>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -212,9 +228,11 @@ namespace IRaCIS.Core.API
|
||||||
//文件伺服 必须带Token 访问
|
//文件伺服 必须带Token 访问
|
||||||
//app.UseIRacisHostStaticFileStore(env);
|
//app.UseIRacisHostStaticFileStore(env);
|
||||||
|
|
||||||
|
app.UseCors();
|
||||||
app.UseEndpoints(endpoints =>
|
app.UseEndpoints(endpoints =>
|
||||||
{
|
{
|
||||||
endpoints.MapHub<UploadHub>("/UploadHub");
|
endpoints.MapHub<UploadHub>("/UploadHub" ).RequireCors(t=>t.WithOrigins(new string[] {"null"}).AllowAnyMethod().AllowAnyHeader().AllowCredentials());
|
||||||
|
|
||||||
endpoints.MapControllers();
|
endpoints.MapControllers();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue