Большое обновление
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
using Gotenberg.Sharp.API.Client;
|
||||
using Gotenberg.Sharp.API.Client.Domain.Settings;
|
||||
using Gotenberg.Sharp.API.Client.Extensions;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc.Authorization;
|
||||
using Microsoft.Identity.Web;
|
||||
using Microsoft.Identity.Web.UI;
|
||||
using Otchinslator.Components;
|
||||
using Otchinslator.Services;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@@ -14,13 +18,17 @@ builder.Services.AddControllersWithViews(options =>
|
||||
.RequireAuthenticatedUser()
|
||||
.Build();
|
||||
options.Filters.Add(new AuthorizeFilter(policy));
|
||||
}).AddMicrosoftIdentityUI();
|
||||
}).AddMicrosoftIdentityUI().AddDataAnnotationsLocalization();
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveServerComponents();
|
||||
|
||||
builder.Services.AddRazorPages(); //////////////
|
||||
builder.Services.AddServerSideBlazor(); ///////////////
|
||||
builder.Services.AddOptions<GotenbergSharpClientOptions>()
|
||||
.Bind(builder.Configuration.GetSection(nameof(GotenbergSharpClient)));
|
||||
builder.Services.AddGotenbergSharpClient();
|
||||
builder.Services.AddScoped<IStatementGenerator, StatementGenerator>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
@@ -34,7 +42,7 @@ app.UseStaticFiles();
|
||||
app.UseAntiforgery();
|
||||
app.MapControllers();
|
||||
|
||||
app.MapRazorComponents<App>()
|
||||
.AddInteractiveServerRenderMode();
|
||||
app.MapRazorComponents<App>();
|
||||
// .AddInteractiveServerRenderMode();
|
||||
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user