This commit is contained in:
2025-05-13 11:27:58 +08:00
parent 4d83091c5c
commit c81f267ecc
8 changed files with 9 additions and 9 deletions

View File

@@ -422,7 +422,7 @@
{
x.AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(10);
var articles = _db.Articles.Where(x => x.Type == ArticleTypeEnum.Page).OrderByDescending(x => x.Sort).Take(top).Select(x => x.ArticleEntityToSinglePage()).ToList();
var articles = _db.Articles.Where(x => x.Type == ArticleTypeEnum.Page && x.Status != ArticleStatusEnum.Deleted).OrderByDescending(x => x.Sort).Take(top).Select(x => x.ArticleEntityToSinglePage()).ToList();
articles.ForEach(x =>
{
@@ -441,7 +441,7 @@
{
articleEntity = await _db.Articles.FirstOrDefaultAsync(x => x.Slug == slug);
}
if (articleEntity == null)
if (articleEntity == null || articleEntity.Status == ArticleStatusEnum.Deleted)
{
throw new PageNotFoundException();
}