From a602539ec5272ae2c598f03b5c7add5acb327e64 Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Thu, 20 Jan 2022 13:22:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/BootstrapAdmin.Web.Core/Services/AdminService.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/blazor/admin/BootstrapAdmin.Web.Core/Services/AdminService.cs b/src/blazor/admin/BootstrapAdmin.Web.Core/Services/AdminService.cs index aa19c588..5154ba22 100644 --- a/src/blazor/admin/BootstrapAdmin.Web.Core/Services/AdminService.cs +++ b/src/blazor/admin/BootstrapAdmin.Web.Core/Services/AdminService.cs @@ -1,6 +1,5 @@ using Bootstrap.Security.Blazor; using BootstrapAdmin.DataAccess.Models; -using Microsoft.AspNetCore.Components.Authorization; namespace BootstrapAdmin.Web.Core.Services; @@ -66,7 +65,7 @@ public class AdminService : IBootstrapAdminService var menu = menus.FirstOrDefault(m => m.Url.Contains(url, StringComparison.OrdinalIgnoreCase)); if (menu != null) { - ret = menus.FirstOrDefault(m => m.ParentId == menu.Id && m.IsResource == EnumResource.Block && m.Url.Equals(blockName, StringComparison.OrdinalIgnoreCase)) != null; + ret = menus.Any(m => m.ParentId == menu.Id && m.IsResource == EnumResource.Block && m.Url.Equals(blockName, StringComparison.OrdinalIgnoreCase)); } } return ret;