zhaolei
5 days ago 0b51bf5178442b800fd76f4ff1df5b8e47af7525
commit | author | age
4a2e5b 1 @page "/Pages"
Z 2 @page "/Pages/Admin"
3 @page "/Pages/Admin/Index"
4 @layout DefaultLayout
5 @attribute [Authorize]
6 @inject IJSRuntime JSRuntime
7
8 <Section ShowCardTitle="@Layout.Model.ShowCardTitle" LockScreenPeriod="@Layout.Model.LockScreenPeriod" ShowBackground="true">
5275bb 9     <h4 style="color: #fff; padding: 1rem 0 0 1rem;">欢迎使用小牛集卡后台管理</h4>
4a2e5b 10 </Section>
Z 11
12 @code {
13     [CascadingParameter(Name = "Default")]
14     protected DefaultLayout Layout { get; set; } = new DefaultLayout();
15
16     /// <summary>
17     ///
18     /// </summary>
19     protected override void OnAfterRender(bool firstRender)
20     {
21         var menus = DataAccess.MenuHelper.RetrieveAllMenus(Layout.UserName);
22         var menu = menus.FirstOrDefault(menu => "/Pages/Admin/Index".Contains(menu.Url.ToBlazorMenuUrl(), StringComparison.OrdinalIgnoreCase));
23         JSRuntime.ActiveMenu(menu.Id);
24     }
25 }