diff --git a/src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor.css b/src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor.css index aea3b9b5a68..def7eb42ee3 100644 --- a/src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor.css +++ b/src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor.css @@ -18,22 +18,18 @@ font-weight: 700; } -::deep p { - line-height: 2; +::deep p:last-child { + margin-bottom: 0; } - ::deep p:last-child { - margin-bottom: 0; - } - - ::deep p code, - ::deep li code { - display: inline-block; - padding: 0px 8px; - background-color: #e9ecef; - margin: 0; - border-radius: var(--bs-border-radius); - } +::deep p code, +::deep li code { + display: inline-block; + padding: 0px 8px; + background-color: #e9ecef; + margin: 0; + border-radius: var(--bs-border-radius); +} ::deep .code-label { font-weight: bold; diff --git a/src/BootstrapBlazor.Server/Components/Layout/PracticeLayout.razor.css b/src/BootstrapBlazor.Server/Components/Layout/PracticeLayout.razor.css index 31b38341cc2..3c76b664662 100644 --- a/src/BootstrapBlazor.Server/Components/Layout/PracticeLayout.razor.css +++ b/src/BootstrapBlazor.Server/Components/Layout/PracticeLayout.razor.css @@ -18,10 +18,6 @@ font-weight: 700; } -::deep p { - line-height: 2; -} - ::deep p:last-child { margin-bottom: 0; } diff --git a/src/BootstrapBlazor.Server/Components/Samples/Dispatches.razor b/src/BootstrapBlazor.Server/Components/Samples/Dispatches.razor index 90e676d5b29..fc1408364d9 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Dispatches.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Dispatches.razor @@ -11,17 +11,17 @@
@Localizer["NormalTip"]
@((MarkupString)Localizer["NormalTips1"].Value)
-[Inject] +[Inject] [NotNull] private IDispatchService<GiteePostBody>? DispatchService { get; set; }@((MarkupString)Localizer["NormalTips2"].Value)
-protected override void OnInitialized() +protected override void OnInitialized() { // ... DispatchService.Subscribe(Notify); }@((MarkupString)Localizer["NormalTips3"].Value)
-private void Dispose(bool disposing) +private void Dispose(bool disposing) { if (disposing) { @@ -29,7 +29,7 @@ private IDispatchService<GiteePostBody>? DispatchService { get; set; }@((MarkupString)Localizer["NormalTips4"].Value)
-private async Task Notify(DispatchEntry<GiteePostBody> payload) +private async Task Notify(DispatchEntry<GiteePostBody> payload) { if (payload.Entry != null) { diff --git a/src/BootstrapBlazor/Components/IPLocator/DefaultIPLocator.cs b/src/BootstrapBlazor/Components/IPLocator/DefaultIPLocator.cs index 2bcab1253b0..61e83e79239 100644 --- a/src/BootstrapBlazor/Components/IPLocator/DefaultIPLocator.cs +++ b/src/BootstrapBlazor/Components/IPLocator/DefaultIPLocator.cs @@ -4,6 +4,9 @@ using Microsoft.Extensions.Logging; using System.Net.Http.Json; +using System.Text.Encodings.Web; +using System.Text.Json; +using System.Text.Unicode; namespace BootstrapBlazor.Components; @@ -12,6 +15,18 @@ namespace BootstrapBlazor.Components; /// public class DefaultIPLocator : IIPLocator { + private readonly JsonSerializerOptions _options; + ///+ /// 构造函数 + /// + public DefaultIPLocator() + { + _options = new JsonSerializerOptions() + { + Encoder = JavaScriptEncoder.Create(UnicodeRanges.All) + }; + } + ////// @@ -29,7 +44,7 @@ public class DefaultIPLocator : IIPLocator /// /// ////// - protected virtual async Task Locate (IPLocatorOption option) where T : class + protected virtual async Task Locate (IPLocatorOption option) { string? ret = null; if (!string.IsNullOrEmpty(Url) && !string.IsNullOrEmpty(option.IP) && option.HttpClient != null) @@ -38,7 +53,7 @@ public class DefaultIPLocator : IIPLocator try { using var token = new CancellationTokenSource(option.RequestTimeout); - var result = await option.HttpClient.GetFromJsonAsync (url, token.Token); + var result = await option.HttpClient.GetFromJsonAsync (url, _options, token.Token); if (result != null) { ret = result.ToString();