diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs index e81a882baa..e00ec6bb34 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs @@ -1,5 +1,6 @@ using System; using Volo.Abp.Application.Dtos; +using Volo.CmsKit.Pages; namespace Volo.CmsKit.Contents; @@ -16,4 +17,6 @@ public class PageDto : ExtensibleEntityDto public string Script { get; set; } public string Style { get; set; } + + public PageStatus Status { get; set; } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs index cd0191e20d..b69a2e18d6 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs @@ -54,6 +54,12 @@ public class PagePublicAppService : CmsKitPublicAppServiceBase, IPagePublicAppSe return null; } + // Only return published home page + if (page.Status != PageStatus.Publish) + { + return null; + } + pageCacheItem = ObjectMapper.Map(page); await PageCache.SetAsync(PageCacheItem.GetKey(PageConsts.DefaultHomePageCacheKey), pageCacheItem, @@ -81,6 +87,12 @@ public class PagePublicAppService : CmsKitPublicAppServiceBase, IPagePublicAppSe return null; } + // Only return published pages + if (page.Status != PageStatus.Publish) + { + return null; + } + return ObjectMapper.Map(page); });