public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            app.UseStaticFiles(new StaticFileOptions
            {
                FileProvider = new PhysicalFileProvider(env.ContentRootPath + "/assets"),
                OnPrepareResponse = (c) =>
                {
                    c.Context.Response.Headers.Add("Access-Control-Allow-Origin", "*");
                },
                RequestPath = "/services/v1/assets"
            });
    }

  修改返回头部

c.Context.Response.Headers.Add("Access-Control-Allow-Origin", "*");

相关文章:

  • 2022-02-24
  • 2021-09-27
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2022-01-08
相关资源
相似解决方案