修复列表展示问题

This commit is contained in:
橙子
2022-10-16 16:09:45 +08:00
parent cf43dc8e70
commit 6d99539730
3 changed files with 3 additions and 3 deletions

View File

@@ -50,7 +50,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
public override Task<Result> Add(ArticleEntity entity)
{
//如果标题为空默认为内容的前20个字符
entity.Title = entity.Title ?? entity.Content.Substring(0, 20);
entity.Title = string.IsNullOrEmpty(entity.Title) ? entity.Content.Substring(0, 20): entity.Title;
entity.UserId = HttpContext.GetUserIdInfo();
return base.Add(entity);
}