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
版权声明:本文为博主原创文章,转载请附上博文链接!

posted @ 2018-10-31 17:30  风轻2022  阅读(485)  评论(0编辑  收藏  举报