Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/BootstrapBlazor.Server/Components/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<link rel="stylesheet" href="@Assets["_content/BootstrapBlazor.Shared/BootstrapBlazor.Shared.bundle.scp.css"]" />
<link rel="stylesheet" href="@Assets["_content/BootstrapBlazor.Shared/css/site.css"]" />

<ImportMap></ImportMap>

<HeadOutlet @rendermode="new InteractiveServerRenderMode(false)" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

using BootstrapBlazor.Service.Services;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Options;
using System.Text.Encodings.Web;
using System.Text.Unicode;

Expand All @@ -17,9 +18,27 @@ public static IServiceCollection AddBootstrapBlazorServerService(this IServiceCo
// 增加中文编码支持网页源码显示汉字
services.AddSingleton(HtmlEncoder.Create(UnicodeRanges.All));

// 增加错误日志
services.AddLogging(logBuilder => logBuilder.AddFileLogger());

// 增加跨域服务
services.AddCors();

// 增加多语言支持配置信息
services.AddRequestLocalization<IOptionsMonitor<BootstrapBlazorOptions>>((localizerOption, blazorOption) =>
{
blazorOption.OnChange(Invoke);
Invoke(blazorOption.CurrentValue);
return;

void Invoke(BootstrapBlazorOptions option)
{
var supportedCultures = option.GetSupportedCultures();
localizerOption.SupportedCultures = supportedCultures;
localizerOption.SupportedUICultures = supportedCultures;
}
});

#if DEBUG
#else
services.AddResponseCompression(options =>
Expand All @@ -34,8 +53,8 @@ public static IServiceCollection AddBootstrapBlazorServerService(this IServiceCo
// 增加 SignalR 服务数据传输大小限制配置
services.Configure<HubOptions>(option => option.MaximumReceiveMessageSize = null);

// 增加错误日志
services.AddLogging(logging => logging.AddFileLogger());
// 增加授权服务
services.AddAuthorization();

// 增加后台任务服务
services.AddTaskServices();
Expand Down
1 change: 0 additions & 1 deletion src/BootstrapBlazor.Shared/BootstrapBlazor.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
<PackageReference Include="BootstrapBlazor.SvgEditor" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.SummerNote" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.TableExport" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.TagHelper" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.Topology" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.VideoPlayer" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.WinBox" Version="9.0.5" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,6 @@ public static IServiceCollection AddBootstrapBlazorServices(this IServiceCollect
// 增加 Baidu ORC 服务
services.AddBootstrapBlazorBaiduOcr();

// 增加多语言支持配置信息
services.AddRequestLocalization<IOptionsMonitor<BootstrapBlazorOptions>>((localizerOption, blazorOption) =>
{
blazorOption.OnChange(Invoke);
Invoke(blazorOption.CurrentValue);
return;

void Invoke(BootstrapBlazorOptions option)
{
var supportedCultures = option.GetSupportedCultures();
localizerOption.SupportedCultures = supportedCultures;
localizerOption.SupportedUICultures = supportedCultures;
}
});

// 增加 AzureOpenAI 服务
services.AddBootstrapBlazorAzureOpenAIService();

Expand Down Expand Up @@ -86,9 +71,6 @@ void Invoke(BootstrapBlazorOptions option)
// 增加 Table Excel 导出服务
services.AddBootstrapBlazorTableExportService();

// 增加 脚本版本服务
services.AddBootstrapAppendVersionService();

// 增加 PetaPoco ORM 数据服务操作类
// 需要时打开下面代码
//services.AddPetaPoco(option =>
Expand Down Expand Up @@ -147,7 +129,6 @@ public static IServiceCollection AddWebSiteServices(this IServiceCollection serv
services.AddOptionsMonitor<WebsiteOptions>();

// 增加模拟登录服务
services.AddAuthorization();
services.AddCascadingAuthenticationState();
services.AddScoped<AuthenticationStateProvider, MockAuthenticationStateProvider>();

Expand Down
Loading