From 3118e2c7e8393e1a6b580cfa42830c07a468b8d9 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Fri, 13 Oct 2023 10:53:19 +0800 Subject: [PATCH 1/2] Check MenuEnable feature --- .../Menus/CmsKitPublicMenuContributor.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Menus/CmsKitPublicMenuContributor.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Menus/CmsKitPublicMenuContributor.cs index 2753816af0..323a280b3b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Menus/CmsKitPublicMenuContributor.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Menus/CmsKitPublicMenuContributor.cs @@ -2,8 +2,10 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.Abp.UI.Navigation; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Menus; using Volo.CmsKit.Public.Menus; @@ -22,7 +24,8 @@ public class CmsKitPublicMenuContributor : IMenuContributor private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) { - if (GlobalFeatureManager.Instance.IsEnabled()) + var featureChecker = context.ServiceProvider.GetRequiredService(); + if (GlobalFeatureManager.Instance.IsEnabled() && featureChecker.IsEnabledAsync(CmsKitFeatures.MenuEnable)) { var menuAppService = context.ServiceProvider.GetRequiredService(); From ceec91bee354fcf7d5eb59ecbc013880fc5b4f5f Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Fri, 13 Oct 2023 13:54:10 +0800 Subject: [PATCH 2/2] Update CmsKitPublicMenuContributor.cs --- .../Volo.CmsKit.Public.Web/Menus/CmsKitPublicMenuContributor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Menus/CmsKitPublicMenuContributor.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Menus/CmsKitPublicMenuContributor.cs index 323a280b3b..7d9bc797b9 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Menus/CmsKitPublicMenuContributor.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Menus/CmsKitPublicMenuContributor.cs @@ -25,7 +25,7 @@ public class CmsKitPublicMenuContributor : IMenuContributor private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) { var featureChecker = context.ServiceProvider.GetRequiredService(); - if (GlobalFeatureManager.Instance.IsEnabled() && featureChecker.IsEnabledAsync(CmsKitFeatures.MenuEnable)) + if (GlobalFeatureManager.Instance.IsEnabled() && await featureChecker.IsEnabledAsync(CmsKitFeatures.MenuEnable)) { var menuAppService = context.ServiceProvider.GetRequiredService();