zoukankan      html  css  js  c++  java
  • .NetCore跨域

      "App":  {
      "CorsOrigins": "http://manage.l.cn,http://www..cn,https://www.lu.cn,,http://u.cn,https://portal.edu.cn"
      },
      services.AddCors(options =>
                {
                    options.AddPolicy("localhost", builder =>
                    {
                        //App:CorsOrigins in appsettings.json can contain more than one address with splitted by comma.
                        builder
                            .WithOrigins(
                                // App:CorsOrigins in appsettings.json can contain more than one address separated by comma.
                                _appConfiguration["App:CorsOrigins"]
                                    .Split(",", StringSplitOptions.RemoveEmptyEntries)
                                    .Select(o => o.RemovePostFix("/"))
                                    .ToArray()
                            )
                            .SetIsOriginAllowedToAllowWildcardSubdomains()
                            .AllowAnyHeader()
                            .AllowAnyMethod()
                            .AllowCredentials();
                    });
                });
  • 相关阅读:
    第九周作业
    第八周作业
    第七周作业
    作业2
    作业1
    2019春总结作业
    第十四周总结
    十二周编程总结
    十一周编程总结
    第十周作业
  • 原文地址:https://www.cnblogs.com/wangyinlon/p/13168171.html
Copyright © 2011-2022 走看看