ASP.NET Core SignalR CORS 跨域问题
引用: https://www.cnblogs.com/IT-Ramon/p/12156832.html
Startup类:
ConfigureServices方法添加:
services.AddCors(op => { op.AddPolicy(“cors”, set => { set.SetIsOriginAllowed(origin => true).AllowAnyHeader().AllowAnyMethod().AllowCredentials(); }); });
Configure:方法添加Cors:
app.UseCors(“cors”);