Skip to content

Commit 81cebcf

Browse files
committed
doc: 更新示例
1 parent 8b148fe commit 81cebcf

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

src/BootstrapBlazor.Server/Components/Samples/BrowserFingers.razor

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ private async Task GetFingerCodeAsync()
1414
<BootstrapInputGroupLabel DisplayText="Browser-Finger"></BootstrapInputGroupLabel>
1515
<BootstrapInput @bind-Value="@_code" />
1616
</BootstrapInputGroup>
17+
18+
<BootstrapInputGroup>
19+
<BootstrapInputGroupLabel DisplayText="ClientHubId"></BootstrapInputGroupLabel>
20+
<BootstrapInput @bind-Value="@_clientId" />
21+
</BootstrapInputGroup>
1722
</DemoBlock>
1823

1924
<MethodTable Items="GetMethods()" />

src/BootstrapBlazor.Server/Components/Samples/BrowserFingers.razor.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public partial class BrowserFingers
1515
private IBrowserFingerService? BrowserFingerService { get; set; }
1616

1717
private string? _code;
18+
private string? _clientHubId;
1819

1920
/// <summary>
2021
/// <inheritdoc/>
@@ -25,10 +26,13 @@ protected override async Task OnInitializedAsync()
2526
await base.OnInitializedAsync();
2627

2728
_code = await GetFingerCodeAsync();
29+
_clientHubId = await GetClientHubIdAsync();
2830
}
2931

3032
private Task<string?> GetFingerCodeAsync() => BrowserFingerService.GetFingerCodeAsync();
3133

34+
private Task<string?> GetClientHubIdAsync() => BrowserFingerService.GetClientHubIdAsync();
35+
3236
private MethodItem[] GetMethods() =>
3337
[
3438
new()
@@ -37,6 +41,13 @@ private MethodItem[] GetMethods() =>
3741
Description = Localizer["GetFingerCodeAsync"],
3842
Parameters = " — ",
3943
ReturnValue = "Task<string?>"
44+
},
45+
new()
46+
{
47+
Name = "GetClientHubIdAsync",
48+
Description = Localizer["GetClientHubIdAsync"],
49+
Parameters = " — ",
50+
ReturnValue = "Task<string?>"
4051
}
4152
];
4253
}

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6685,7 +6685,8 @@
66856685
"BootstrapBlazor.Server.Components.Samples.BrowserFingers": {
66866686
"BrowserFingerTitle": "Browser fingerprint",
66876687
"BrowserFingerIntro": "Obtain the client browser fingerprint by calling the <code>IBrowserFingerService</code> service instance method <code>GetFingerCodeAsync</code>. The fingerprint is consistent in privacy mode",
6688-
"GetFingerCodeAsync": "Method for obtaining fingerprints"
6688+
"GetFingerCodeAsync": "Method for obtaining fingerprints",
6689+
"GetClientHubIdAsync": "Method for obtaining client hub Id"
66896690
},
66906691
"BootstrapBlazor.Server.Components.Samples.SvgEditors": {
66916692
"SvgEditorTitle": "SvgEditor",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6685,7 +6685,8 @@
66856685
"BootstrapBlazor.Server.Components.Samples.BrowserFingers": {
66866686
"BrowserFingerTitle": "浏览器指纹",
66876687
"BrowserFingerIntro": "通过调用 <code>IBrowserFingerService</code> 服务实例方法 <code>GetFingerCodeAsync</code> 获得客户端浏览器指纹,隐私模式下指纹是一致的",
6688-
"GetFingerCodeAsync": "获得指纹方法"
6688+
"GetFingerCodeAsync": "获得指纹方法",
6689+
"GetClientHubIdAsync": "获得客户端连接 Id 方法"
66896690
},
66906691
"BootstrapBlazor.Server.Components.Samples.SvgEditors": {
66916692
"SvgEditorTitle": "Svg 编辑器",

0 commit comments

Comments
 (0)