From 91bf5f93cd5e9b1c57d873d5cb77f3956089b8b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Fri, 15 Nov 2024 21:38:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20bbs=E8=AF=84=E8=AE=BA=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Forum/CommentService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Forum/CommentService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Forum/CommentService.cs index b8926f13..f18cc446 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Forum/CommentService.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Forum/CommentService.cs @@ -136,9 +136,9 @@ namespace Yi.Framework.Bbs.Application.Services.Forum [Authorize] public override async Task CreateAsync(CommentCreateInputVo input) { - if (input.Content.Length<=6) + if (string.IsNullOrWhiteSpace(input.Content)|| input.Content=="


") { - throw new UserFriendlyException("评论长度至少大于6"); + throw new UserFriendlyException("评论不能为空"); } var discuess = await _discussRepository.GetFirstAsync(x => x.Id == input.DiscussId);