feat: 更新 Home 首页逻辑

This commit is contained in:
Argo-Tianyi 2021-12-15 12:37:57 +08:00
parent 54431a131d
commit 08d5e498a0
3 changed files with 32 additions and 6 deletions

View File

@ -1,6 +1,4 @@
@page "/"
@page "/Admin"
@page "/Admin/Index"
@page "/Admin/Index"
@attribute [TabItemOption(Text = "后台管理")]
<h4>欢迎使用后台管理</h4>

View File

@ -0,0 +1,31 @@
namespace BootstrapAdmin.Web.Pages.Home
{
/// <summary>
///
/// </summary>
[Route("/")]
[Route("/Home")]
[Route("/Home/Index")]
public class Index : ComponentBase
{
[Inject]
[NotNull]
private NavigationManager? Navigation { get; set; }
#if DEBUG
/// <summary>
///
/// </summary>
/// <param name="firstRender"></param>
protected override void OnAfterRender(bool firstRender)
{
Navigation.NavigateTo($"/Admin/Index", true);
}
#else
protected override void OnInitialized()
{
Navigation.NavigateTo($"/Admin/Index", true);
}
#endif
}
}

View File

@ -1,3 +0,0 @@
@page "/Home"
@page "/Home/Index"
@attribute [TabItemOption(Text = "首页")]