Skip to content

Commit 4554667

Browse files
committed
refactor: 增加 EnableIpLocator 参数
1 parent ba712eb commit 4554667

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/BootstrapBlazor/Components/ConnectionHub/ConnectionHub.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ protected override async Task InvokeInitAsync()
5151
Method = nameof(Callback),
5252
ConnectionId = Guid.NewGuid(),
5353
Interval = options.BeatInterval.TotalMilliseconds,
54-
Url = "ip.axd"
54+
Url = "ip.axd",
55+
BootstrapBlazorOptions.Value.WebClientOptions.EnableIpLocator
5556
});
5657
}
5758
}

src/BootstrapBlazor/Services/WebClientService.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ public async Task<ClientInfo> GetClientInfo()
4444
{
4545
_jsModule ??= await runtime.LoadModuleByName("client");
4646
_interop ??= DotNetObjectReference.Create(this);
47-
await _jsModule.InvokeVoidAsync("ping", "ip.axd", _interop, nameof(SetData));
47+
await _jsModule.InvokeVoidAsync("ping", "ip.axd", _interop, nameof(SetData), new
48+
{
49+
options.CurrentValue.WebClientOptions.EnableIpLocator
50+
});
4851

4952
// 等待 SetData 方法执行完毕
5053
await _taskCompletionSource.Task.WaitAsync(TimeSpan.FromSeconds(3));

0 commit comments

Comments
 (0)