其他分享
首页 > 其他分享> > note

note

作者:互联网

一:

01,跨域:Microsoft.AspNetCore.Cors

 //添加cors 服务 配置跨域处理            
            services.AddCors(options =>
            {
                options.AddPolicy("any", builder =>
                {
                    builder.WithMethods("GET", "POST", "HEAD", "PUT", "DELETE", "OPTIONS")
                    //.AllowCredentials()//指定处理cookie
                .AllowAnyOrigin(); //允许任何来源的主机访问
                });
            });

 

标签:跨域,any,builder,options,note,WithMethods,AspNetCore
来源: https://www.cnblogs.com/Insist-Y/p/15970073.html