1.添加中间件
在ConfigureServices中添加
//跨域中间件服务 ???????????services.AddCors();
在 Configure中添加
//跨域配置 ???????????app.UseCors(builder => builder.WithOrigins("http://example.com").AllowAnyHeader());
asp.net Core 跨域配置
原文地址:https://www.cnblogs.com/xuqp/p/9996687.html