File tree Expand file tree Collapse file tree 4 files changed +23
-22
lines changed Expand file tree Collapse file tree 4 files changed +23
-22
lines changed Original file line number Diff line number Diff line change 2727 <link rel =" stylesheet" href =" @Assets[" _content /BootstrapBlazor.Shared /BootstrapBlazor.Shared.bundle.scp.css " ]" />
2828 <link rel =" stylesheet" href =" @Assets[" _content /BootstrapBlazor.Shared /css /site.css " ]" />
2929
30+ <ImportMap ></ImportMap >
31+
3032 <HeadOutlet @rendermode =" new InteractiveServerRenderMode(false)" />
3133</head >
3234
Original file line number Diff line number Diff line change 55
66using BootstrapBlazor . Service . Services ;
77using Microsoft . AspNetCore . SignalR ;
8+ using Microsoft . Extensions . Options ;
89using System . Text . Encodings . Web ;
910using System . Text . Unicode ;
1011
@@ -17,9 +18,27 @@ public static IServiceCollection AddBootstrapBlazorServerService(this IServiceCo
1718 // 增加中文编码支持网页源码显示汉字
1819 services . AddSingleton ( HtmlEncoder . Create ( UnicodeRanges . All ) ) ;
1920
21+ // 增加错误日志
2022 services . AddLogging ( logBuilder => logBuilder . AddFileLogger ( ) ) ;
23+
24+ // 增加跨域服务
2125 services . AddCors ( ) ;
2226
27+ // 增加多语言支持配置信息
28+ services . AddRequestLocalization < IOptionsMonitor < BootstrapBlazorOptions > > ( ( localizerOption , blazorOption ) =>
29+ {
30+ blazorOption . OnChange ( Invoke ) ;
31+ Invoke ( blazorOption . CurrentValue ) ;
32+ return ;
33+
34+ void Invoke ( BootstrapBlazorOptions option )
35+ {
36+ var supportedCultures = option . GetSupportedCultures ( ) ;
37+ localizerOption . SupportedCultures = supportedCultures ;
38+ localizerOption . SupportedUICultures = supportedCultures ;
39+ }
40+ } ) ;
41+
2342#if DEBUG
2443#else
2544 services . AddResponseCompression ( options =>
@@ -34,8 +53,8 @@ public static IServiceCollection AddBootstrapBlazorServerService(this IServiceCo
3453 // 增加 SignalR 服务数据传输大小限制配置
3554 services . Configure < HubOptions > ( option => option . MaximumReceiveMessageSize = null ) ;
3655
37- // 增加错误日志
38- services . AddLogging ( logging => logging . AddFileLogger ( ) ) ;
56+ // 增加授权服务
57+ services . AddAuthorization ( ) ;
3958
4059 // 增加后台任务服务
4160 services . AddTaskServices ( ) ;
Original file line number Diff line number Diff line change 5959 <PackageReference Include =" BootstrapBlazor.SvgEditor" Version =" 9.0.0" />
6060 <PackageReference Include =" BootstrapBlazor.SummerNote" Version =" 9.0.1" />
6161 <PackageReference Include =" BootstrapBlazor.TableExport" Version =" 9.0.0" />
62- <PackageReference Include =" BootstrapBlazor.TagHelper" Version =" 9.0.0" />
6362 <PackageReference Include =" BootstrapBlazor.Topology" Version =" 9.0.0" />
6463 <PackageReference Include =" BootstrapBlazor.VideoPlayer" Version =" 9.0.1" />
6564 <PackageReference Include =" BootstrapBlazor.WinBox" Version =" 9.0.5" />
Original file line number Diff line number Diff line change @@ -35,21 +35,6 @@ public static IServiceCollection AddBootstrapBlazorServices(this IServiceCollect
3535 // 增加 Baidu ORC 服务
3636 services . AddBootstrapBlazorBaiduOcr ( ) ;
3737
38- // 增加多语言支持配置信息
39- services . AddRequestLocalization < IOptionsMonitor < BootstrapBlazorOptions > > ( ( localizerOption , blazorOption ) =>
40- {
41- blazorOption . OnChange ( Invoke ) ;
42- Invoke ( blazorOption . CurrentValue ) ;
43- return ;
44-
45- void Invoke ( BootstrapBlazorOptions option )
46- {
47- var supportedCultures = option . GetSupportedCultures ( ) ;
48- localizerOption . SupportedCultures = supportedCultures ;
49- localizerOption . SupportedUICultures = supportedCultures ;
50- }
51- } ) ;
52-
5338 // 增加 AzureOpenAI 服务
5439 services . AddBootstrapBlazorAzureOpenAIService ( ) ;
5540
@@ -86,9 +71,6 @@ void Invoke(BootstrapBlazorOptions option)
8671 // 增加 Table Excel 导出服务
8772 services . AddBootstrapBlazorTableExportService ( ) ;
8873
89- // 增加 脚本版本服务
90- services . AddBootstrapAppendVersionService ( ) ;
91-
9274 // 增加 PetaPoco ORM 数据服务操作类
9375 // 需要时打开下面代码
9476 //services.AddPetaPoco(option =>
@@ -147,7 +129,6 @@ public static IServiceCollection AddWebSiteServices(this IServiceCollection serv
147129 services . AddOptionsMonitor < WebsiteOptions > ( ) ;
148130
149131 // 增加模拟登录服务
150- services . AddAuthorization ( ) ;
151132 services . AddCascadingAuthenticationState ( ) ;
152133 services . AddScoped < AuthenticationStateProvider , MockAuthenticationStateProvider > ( ) ;
153134
You can’t perform that action at this time.
0 commit comments