当前位置:网站首页>NETCORE 3.1 solves cross domain problems

NETCORE 3.1 solves cross domain problems

2022-07-07 09:27:00 -Coffee-

stay  Startup Class  

(1)ConfigureServices Function :

 // Configure cross domain processing , Allow all sources
 

services.AddCors(options =>
                options.AddPolicy("all", p => p.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader())
    );

(2) Configure Function :

 

 app.UseCors("all");

 ok , Perfect solution

原网站

版权声明
本文为[-Coffee-]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130624592902.html