feat: 修复菜单导航

This commit is contained in:
Argo-Tianyi 2021-12-29 12:25:37 +08:00
parent c7b385cd67
commit 25af048f77
4 changed files with 10 additions and 3 deletions

View File

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

View File

@ -1,4 +1,5 @@
@page "/Admin/Profiles"
@attribute [TabItemOption(Text = "个人中心", Icon = "fa fa-suitcase")]
<div class="tab-scroll-body">
<AdminCard HeaderText="基本资料" AuthorizeKey="SaveDisplayName">

View File

@ -8,10 +8,10 @@
<span class="ms-3 flex-fill">Bootstrap of Blazor</span>
<Logout ImageUrl="/images/Argo.png" DisplayName="@DisplayName" UserName="Admin">
<LinkTemplate>
<a href="/Admin/Profiles"><i class=" fa fa-suitcase"></i>个人中心</a>
<a href="/Admin/Profiles"><i class="fa fa-suitcase"></i>个人中心</a>
<a href="/Admin/Index"><i class="fa fa-cog"></i>设置</a>
<a href="/Admin/Notifications"><i class="fa fa-bell"></i>通知<span id="logoutNoti" class="badge badge-pill badge-success"></span></a>
<a href="/Account/Logout"><i class="fa fa-key"></i>注销</a>
<a href="#" @onclick="OnLogout"><i class="fa fa-key"></i>注销</a>
</LinkTemplate>
</Logout>
<div class="layout-drawer"><i class="fa fa-gears"></i></div>

View File

@ -13,6 +13,10 @@ namespace BootstrapAdmin.Web.Shared
{
private IEnumerable<MenuItem>? MenuItems { get; set; }
[Inject]
[NotNull]
private NavigationManager? NavigationManager { get; set; }
[Inject]
[NotNull]
private INavigation? NavigationsService { get; set; }
@ -66,5 +70,7 @@ namespace BootstrapAdmin.Web.Shared
}
private Task<bool> OnAuthorizing(string url) => SecurityService.AuhorizingNavigation(Context.UserName, url);
private void OnLogout() => NavigationManager.NavigateTo("/Account/Logout", true);
}
}