feat: 添加 Card 是否显示
This commit is contained in:
parent
267d0e68bd
commit
cacea459c1
|
@ -1,4 +1,4 @@
|
|||
<Block Name="@AuthorizeKey">
|
||||
<Block Name="@AuthorizeKey" OnQueryCondition="OnQueryCondition">
|
||||
<Card IsShadow="true">
|
||||
<CardHeader>
|
||||
@HeaderText
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
namespace BootstrapAdmin.Web.Components
|
||||
using BootstrapAdmin.Web.Core;
|
||||
using BootstrapAdmin.Web.Services;
|
||||
|
||||
namespace BootstrapAdmin.Web.Components
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -24,5 +27,24 @@
|
|||
/// </summary>
|
||||
[Parameter]
|
||||
public RenderFragment? ChildContent { get; set; }
|
||||
|
||||
[Inject]
|
||||
[NotNull]
|
||||
private INavigation? NavigationService { get; set; }
|
||||
|
||||
[Inject]
|
||||
[NotNull]
|
||||
private BootstrapAppContext? AppContext { get; set; }
|
||||
|
||||
[Inject]
|
||||
[NotNull]
|
||||
private NavigationManager? NavigationManager { get; set; }
|
||||
|
||||
private Task<bool> OnQueryCondition(string name)
|
||||
{
|
||||
var url = NavigationManager.ToBaseRelativePath(NavigationManager.Uri);
|
||||
|
||||
return Task.FromResult(NavigationService.AuthorizationBlock(AppContext.UserName, url, name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue