Skip to content

Commit 1995553

Browse files
committed
feat(IBrowserFingerService): add GetClientHubIdAsync method
1 parent 09e200c commit 1995553

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/BootstrapBlazor/Services/DefaultBrowserFingerService.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ class DefaultBrowserFingerService(IJSRuntime jSRuntime) : IBrowserFingerService
1313
[NotNull]
1414
private JSModule? _module = null;
1515

16-
/// <summary>
17-
/// 获取剪切板数据方法
18-
/// </summary>
1916
public async Task<string?> GetFingerCodeAsync(CancellationToken token = default)
2017
{
2118
_module ??= await jSRuntime.LoadUtility();
2219
return await _module.InvokeAsync<string?>("getFingerCode", token);
2320
}
21+
22+
public async Task<string?> GetClientHubIdAsync(CancellationToken token = default)
23+
{
24+
_module ??= await jSRuntime.LoadUtility();
25+
return await _module.InvokeAsync<string?>("getClientHubId", token);
26+
}
2427
}

src/BootstrapBlazor/Services/IBrowserFingerService.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,11 @@ public interface IBrowserFingerService
1515
/// </summary>
1616
/// <returns></returns>
1717
Task<string?> GetFingerCodeAsync(CancellationToken token = default);
18+
19+
/// <summary>
20+
/// 获得当前连接的客户端 ID 由 BootstrapBlazor 组件框架提供
21+
/// </summary>
22+
/// <param name="token"></param>
23+
/// <returns></returns>
24+
Task<string?> GetClientHubIdAsync(CancellationToken token = default);
1825
}

0 commit comments

Comments
 (0)