File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
src/BootstrapBlazor.Server/Extensions Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 1- // Licensed to the .NET Foundation under one or more agreements.
1+ // Licensed to the .NET Foundation under one or more agreements.
22// The .NET Foundation licenses this file to you under the Apache 2.0 License
33// See the LICENSE file in the project root for more information.
44// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -18,8 +18,12 @@ public static IServiceCollection AddBootstrapBlazorServerService(this IServiceCo
1818 // 增加中文编码支持网页源码显示汉字
1919 services . AddSingleton ( HtmlEncoder . Create ( UnicodeRanges . All ) ) ;
2020
21- // 增加错误日志
22- services . AddLogging ( logging => logging . AddFileLogger ( ) ) ;
21+ // 增加错误日志,并过滤已知的防伪 Token 解密噪音日志
22+ services . AddLogging ( logging =>
23+ {
24+ logging . AddFileLogger ( ) ;
25+ logging . AddFilter ( "Microsoft.AspNetCore.Antiforgery" , LogLevel . None ) ;
26+ } ) ;
2327
2428 // 增加多语言支持配置信息
2529 services . AddRequestLocalization < IOptions < BootstrapBlazorOptions > > ( ( localizerOption , blazorOption ) =>
Original file line number Diff line number Diff line change 44// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
55
66using Microsoft . AspNetCore . Components . Authorization ;
7- using Microsoft . AspNetCore . DataProtection ;
87
98namespace Microsoft . Extensions . DependencyInjection ;
109
@@ -99,9 +98,7 @@ public static IServiceCollection AddBootstrapBlazorServices(this IServiceCollect
9998 services . AddBootstrapBlazorRegionService ( ) ;
10099
101100 // 增加密钥存储配置
102- services . AddDataProtection ( )
103- . SetApplicationName ( "BootstrapBlazor" )
104- . PersistKeysToFileSystem ( new DirectoryInfo ( Path . Combine ( AppContext . BaseDirectory , "keys" ) ) ) ;
101+ services . AddDataProtection ( ) ;
105102
106103 // 增加 PetaPoco ORM 数据服务操作类
107104 // 需要时打开下面代码
You can’t perform that action at this time.
0 commit comments