diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/DefaultHomePageMiddleware.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/DefaultHomePageMiddleware.cs index f80cba3970..752e5f2f42 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/DefaultHomePageMiddleware.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/DefaultHomePageMiddleware.cs @@ -1,5 +1,4 @@ -using System.Net; -using System.Threading.Tasks; +using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.DependencyInjection; @@ -16,9 +15,9 @@ public class DefaultHomePageMiddleware : IMiddleware, ITransientDependency { var featureChecker = context.RequestServices.GetRequiredService(); - if (await featureChecker.IsEnabledAsync(CmsKitFeatures.PageEnable)) + if (context.Request.Path.Value == "/") { - if (context.Request.Path.Value == "/") + if (await featureChecker.IsEnabledAsync(CmsKitFeatures.PageEnable)) { var pagePublicAppService = context.RequestServices.GetRequiredService(); @@ -32,4 +31,4 @@ public class DefaultHomePageMiddleware : IMiddleware, ITransientDependency await next(context); } -} \ No newline at end of file +}