Skip to content

Commit 534c3d6

Browse files
committed
refactor: 使用 ToAbsoluteUri 防止报错
1 parent e302db3 commit 534c3d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BootstrapBlazor/Components/Layout/Layout.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ protected override async Task OnInitializedAsync()
491491
// wasm 模式下 开启权限必须提供 AdditionalAssemblies 参数
492492
AdditionalAssemblies ??= [Assembly.GetEntryAssembly()!];
493493

494-
var url = Navigation.ToBaseRelativePath(Navigation.Uri);
495-
var context = RouteTableFactory.Create(AdditionalAssemblies, url);
494+
var uri= Navigation.ToAbsoluteUri(Navigation.Uri);
495+
var context = RouteTableFactory.Create(AdditionalAssemblies, uri.LocalPath);
496496
if (context.Handler != null)
497497
{
498498
IsAuthenticated = await context.Handler.IsAuthorizedAsync(ServiceProvider, AuthenticationStateTask, Resource);

0 commit comments

Comments
 (0)