shanji 3 years ago
parent
commit
2d09b57939
  1. 12
      BBWY.Server.API/Startup.cs

12
BBWY.Server.API/Startup.cs

@ -64,10 +64,10 @@ namespace BBWY.Server.API
services.AddHttpClient();
services.AddCors(options =>
{
options.AddDefaultPolicy(p =>
{
p.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader();
});
options.AddPolicy("cors", p =>
{
p.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader();
});
});
services.AddControllers(configure =>
{
@ -134,7 +134,7 @@ namespace BBWY.Server.API
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env,YunDingBusiness yunDingBusiness)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, YunDingBusiness yunDingBusiness)
{
yunDingBusiness.RefreshKey();
app.UseSwagger(c => c.SerializeAsV2 = true)
@ -152,6 +152,8 @@ namespace BBWY.Server.API
app.UseRouting();
app.UseCors("cors");
app.UseAuthorization();
app.UseEndpoints(endpoints =>

Loading…
Cancel
Save