Compare commits

..
1 Commits
Author SHA1 Message Date
xrain 62ffe47d25 fix cors 2020-02-06 04:17:55 +08:00
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ namespace YYApi
public static IServiceCollection AddYYApi(this IServiceCollection builder, string title,
string description = null)
{
return builder.AddYYAuth().AddYYDoc(title, description).AddCors(x => x.AddDefaultPolicy(po => po.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin()));
return builder.AddYYAuth().AddYYDoc(title, description).AddCors();
}
/// <summary>
@@ -38,7 +38,7 @@ namespace YYApi
public static IApplicationBuilder UseYYApi(this IApplicationBuilder builder, string title = "API文档",
params SubmitMethod[] submitMethods)
{
return builder.UseYYException().UseYYDoc(title, submitMethods).UseMiddleware<YYAuthMiddleware>();
return builder.UseYYException().UseYYDoc(title, submitMethods).UseMiddleware<YYAuthMiddleware>().UseCors(x => x.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin());
}
+2 -2
View File
@@ -25,8 +25,8 @@
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="5.0.0" />
<PackageReference Include="HangFire.Core" Version="1.7.8" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.8" />
<PackageReference Include="HangFire.Core" Version="1.7.9" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.9" />
<PackageReference Include="Hangfire.Console" Version="1.4.2" />
<PackageReference Include="Hangfire.Redis.StackExchange" Version="1.8.1" />
</ItemGroup>