10/20更新

This commit is contained in:
陈淳
2022-10-20 16:33:29 +08:00
parent 0755a4026a
commit ff7eecee55
11 changed files with 127 additions and 7 deletions

View File

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