mirror of https://github.com/abpframework/abp.git
committed by
GitHub
3 changed files with 25 additions and 24 deletions
@ -1,17 +1,10 @@ |
|||||
@inject NavigationManager Navigation |
@inject NavigationManager Navigation |
||||
@inject IJSRuntime JSRuntime |
|
||||
|
|
||||
@code { |
@code { |
||||
|
|
||||
protected override void OnInitialized() |
protected override void OnInitialized() |
||||
{ |
{ |
||||
bool isWebAssembly = JSRuntime is IJSInProcessRuntime; |
Navigation.NavigateTo($"account/login?returnUrl={Uri.EscapeDataString(Navigation.Uri)}", true); |
||||
if (isWebAssembly) |
} |
||||
{ |
|
||||
Navigation.NavigateTo($"authentication/login?returnUrl={Uri.EscapeDataString(Navigation.Uri)}"); |
} |
||||
} |
|
||||
else |
|
||||
{ |
|
||||
Navigation.NavigateTo($"account/login?returnUrl={Uri.EscapeDataString(Navigation.Uri)}", true); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,17 @@ |
|||||
|
@inject NavigationManager Navigation |
||||
|
|
||||
|
@using Volo.Abp.DependencyInjection |
||||
|
@using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic |
||||
|
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication |
||||
|
@inherits RedirectToLogin |
||||
|
@attribute [ExposeServices(typeof(RedirectToLogin))] |
||||
|
@attribute [Dependency(ReplaceServices = true)] |
||||
|
|
||||
|
@code { |
||||
|
|
||||
|
protected override void OnInitialized() |
||||
|
{ |
||||
|
Navigation.NavigateToLogin("authentication/login"); |
||||
|
} |
||||
|
|
||||
|
} |
||||
Loading…
Reference in new issue