完善推荐页显示
This commit is contained in:
@@ -50,7 +50,9 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
public override Task<Result> Add(ArticleEntity entity)
|
||||
{
|
||||
//如果标题为空,默认为内容的前20个字符
|
||||
entity.Title = string.IsNullOrEmpty(entity.Title) ? entity.Content.Substring(0, 20): entity.Title;
|
||||
entity.Title = string.IsNullOrEmpty(entity.Title) ?
|
||||
(entity.Content.Length > 20 ? entity.Content.Substring(0, 20) : entity.Content) :
|
||||
entity.Title;
|
||||
entity.UserId = HttpContext.GetUserIdInfo();
|
||||
return base.Add(entity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user