瀏覽代碼

文章比对

懒得勤快 5 年之前
父節點
當前提交
5d22a8696a
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/Masuit.MyBlogs.Core/Controllers/PostController.cs

+ 2 - 1
src/Masuit.MyBlogs.Core/Controllers/PostController.cs

@@ -391,7 +391,8 @@ namespace Masuit.MyBlogs.Core.Controllers
             }
 
             var post = PostService.GetById(dto.PostId) ?? throw new NotFoundException("文章未找到");
-            if (post.Title.Equals(dto.Title) && post.Content.Equals(dto.Content))
+            var diff = new HtmlDiff.HtmlDiff(post.Content.RemoveHtmlTag(), dto.Content.RemoveHtmlTag());
+            if (post.Title.Equals(dto.Title) && !diff.Build().Contains("diffmod"))
             {
                 return ResultData(null, false, "内容未被修改!");
             }