https://www.cnblogs.com/lhxsoft/p/11889407.html
public void ConfigureServices(IServiceCollection services) { //添加cors 服务 配置跨域处理 services.AddCors(options => { options.AddPolicy("any", builder => { builder.WithMethods("GET", "POST", "HEAD", "PUT", "DELETE", "OPTIONS") //.AllowCredentials()//指定处理cookie .AllowAnyOrigin(); //允许任何来源的主机访问 }); }); }