refactor: 根据 NETCore 3.0 文档移动 Cors 到 Routing 后面
This commit is contained in:
parent
6636c31023
commit
c42bc15890
|
@ -102,18 +102,20 @@ namespace Bootstrap.Admin
|
|||
app.UseExceptionHandler("/Home/Error");
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseStatusCodePagesWithReExecute("/Home/Error/{0}");
|
||||
app.UseCors(builder => builder.WithOrigins(Configuration["AllowOrigins"].Split(',', StringSplitOptions.RemoveEmptyEntries)).AllowAnyHeader().AllowAnyMethod().AllowCredentials());
|
||||
app.UseHttpsRedirection();
|
||||
app.UseResponseCompression();
|
||||
app.UseStaticFiles();
|
||||
app.UseAutoGenerateDatabase();
|
||||
|
||||
app.UseRouting();
|
||||
app.UseCors(builder => builder.WithOrigins(Configuration["AllowOrigins"].Split(',', StringSplitOptions.RemoveEmptyEntries)).AllowAnyHeader().AllowAnyMethod().AllowCredentials());
|
||||
app.UseBootstrapAdminAuthentication("", RoleHelper.RetrievesByUserName, RoleHelper.RetrievesByUrl, AppHelper.RetrievesByUserName);
|
||||
app.UseAuthorization();
|
||||
app.UseSwagger(Configuration["SwaggerPathBase"].TrimEnd('/'));
|
||||
app.UseOnlineUsers(TraceHelper.Filter, TraceHelper.Save);
|
||||
app.UseCacheManager();
|
||||
app.UseOnlineUsers(TraceHelper.Filter, TraceHelper.Save);
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapHub<SignalRHub>("/NotiHub");
|
||||
|
|
|
@ -84,13 +84,12 @@ namespace Bootstrap.Client
|
|||
}
|
||||
|
||||
app.UseStatusCodePagesWithReExecute("/Home/Error/{0}");
|
||||
app.UseCors(builder => builder.WithOrigins(Configuration["AllowOrigins"].Split(',', StringSplitOptions.RemoveEmptyEntries)).AllowAnyHeader().AllowAnyMethod().AllowCredentials());
|
||||
app.UseHttpsRedirection();
|
||||
app.UseResponseCompression();
|
||||
app.UseStaticFiles();
|
||||
app.UseCookiePolicy();
|
||||
|
||||
app.UseRouting();
|
||||
app.UseCors(builder => builder.WithOrigins(Configuration["AllowOrigins"].Split(',', StringSplitOptions.RemoveEmptyEntries)).AllowAnyHeader().AllowAnyMethod().AllowCredentials());
|
||||
app.UseBootstrapAdminAuthentication("2", RoleHelper.RetrievesByUserName, RoleHelper.RetrievesByUrl, AppHelper.RetrievesByUserName);
|
||||
app.UseAuthorization();
|
||||
app.UseCacheManager();
|
||||
|
|
Loading…
Reference in New Issue