public void ConfigureServices(IServiceCollection services)
{
services.AddCors(options =>
{
options.AddPolicy("AllowAll", builder =>
{
builder.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader();
});
});
// other service configurations
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// other app configurations
app.UseCors("AllowAll");
// other app configurations
}
版权归属:
小医仙
许可协议:
本文使用《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》协议授权
评论区