Add redirection to login
This commit is contained in:
@ -18,7 +18,8 @@
|
|||||||
|
|
||||||
<PageTitle>Тестирование экспорта</PageTitle>
|
<PageTitle>Тестирование экспорта</PageTitle>
|
||||||
|
|
||||||
<RadzenSplitter Orientation="Orientation.Vertical" Style="height: 100%; border: 1px solid rgba(0,0,0,.08);">
|
<AuthorizeView>
|
||||||
|
<RadzenSplitter Orientation="Orientation.Vertical" Style="height: 100%; border: 1px solid rgba(0,0,0,.08);">
|
||||||
<RadzenSplitterPane Size="200px">
|
<RadzenSplitterPane Size="200px">
|
||||||
<div style="height: 100%;overflow: auto;">
|
<div style="height: 100%;overflow: auto;">
|
||||||
<RadzenCardGroup Responsive="true">
|
<RadzenCardGroup Responsive="true">
|
||||||
@ -48,7 +49,8 @@
|
|||||||
<RadzenSplitterPane Size="auto" Resizable="false">
|
<RadzenSplitterPane Size="auto" Resizable="false">
|
||||||
<EventConsole @ref=@console />
|
<EventConsole @ref=@console />
|
||||||
</RadzenSplitterPane>
|
</RadzenSplitterPane>
|
||||||
</RadzenSplitter>
|
</RadzenSplitter>
|
||||||
|
</AuthorizeView>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
EventConsole console = default!;
|
EventConsole console = default!;
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
<Router AppAssembly="typeof(Program).Assembly">
|
<Router AppAssembly="typeof(Program).Assembly">
|
||||||
<Found Context="routeData">
|
<Found Context="routeData">
|
||||||
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" />
|
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)">
|
||||||
|
<NotAuthorized>
|
||||||
|
<RedirectToLogin />
|
||||||
|
</NotAuthorized>
|
||||||
|
</AuthorizeRouteView>
|
||||||
</Found>
|
</Found>
|
||||||
</Router>
|
</Router>
|
||||||
|
|||||||
8
Hcs.WebApp/Components/Shared/RedirectToLogin.razor
Normal file
8
Hcs.WebApp/Components/Shared/RedirectToLogin.razor
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
|
@code {
|
||||||
|
protected override void OnInitialized()
|
||||||
|
{
|
||||||
|
NavigationManager.NavigateTo($"account/login?returnUrl={Uri.EscapeDataString(NavigationManager.Uri)}", forceLoad: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user