feat: 重构代码
This commit is contained in:
parent
08b02e9579
commit
a602539ec5
|
@ -1,6 +1,5 @@
|
||||||
using Bootstrap.Security.Blazor;
|
using Bootstrap.Security.Blazor;
|
||||||
using BootstrapAdmin.DataAccess.Models;
|
using BootstrapAdmin.DataAccess.Models;
|
||||||
using Microsoft.AspNetCore.Components.Authorization;
|
|
||||||
|
|
||||||
namespace BootstrapAdmin.Web.Core.Services;
|
namespace BootstrapAdmin.Web.Core.Services;
|
||||||
|
|
||||||
|
@ -66,7 +65,7 @@ public class AdminService : IBootstrapAdminService
|
||||||
var menu = menus.FirstOrDefault(m => m.Url.Contains(url, StringComparison.OrdinalIgnoreCase));
|
var menu = menus.FirstOrDefault(m => m.Url.Contains(url, StringComparison.OrdinalIgnoreCase));
|
||||||
if (menu != null)
|
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;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue