dotnet core 2.1 跨域

.NET Core跨域问题:

1、在Startup.cs中ConfigureServices中添加:

services.AddCors();


2、在Startup.cs中Configure方法中添加:

app.UseCors(builder => builder
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials());


---------------------
作者:枫无叶
来源:CSDN
原文:https://blog.csdn.net/qq_42220663/article/details/82381386
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自www.cnblogs.com/hbyjw/p/9884502.html