-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.razor
37 lines (37 loc) · 1.44 KB
/
App.razor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@inject NavigationManager NavigationManager;
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<AuthorizeReuseTabsRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<NotAuthorized>
@if (context.User.Identity?.IsAuthenticated != true)
{
<RedirectToLogin/>
}
else
{
<p role="alert">You are not authorized to access this resource.</p>
}
</NotAuthorized>
</AuthorizeReuseTabsRouteView>
</Found>
<NotFound>
<PageTitle>404</PageTitle>
<LayoutView Layout="@typeof(UserLayout)">
<ApenHis.Blazor.Pages.Exception._404 />
</LayoutView>
@*<AuthorizeView>
<NotAuthorized>
<LayoutView Layout="@typeof(UserLayout)">
<ApenHis.Blazor.Pages.Exception._404/>
</LayoutView>
</NotAuthorized>
<Authorized>
<LayoutView Layout="@typeof(MainLayout)">
<ApenHis.Blazor.Pages.Exception._404 />
</LayoutView>
</Authorized>
</AuthorizeView>*@
</NotFound>
</Router>
</CascadingAuthenticationState>