🐛 展示文章预览内容

This commit is contained in:
x ronger 2020-01-15 01:00:18 +08:00
parent 90c9d31527
commit 44defa3aa9

View File

@ -176,7 +176,8 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
} else if(type == 2){
ArticleContent articleContent = articleMapper.selectArticleContent(article.getIdArticle());
article.setArticleContent(articleContent.getArticleContent());
} else {
}
if(StringUtils.isBlank(article.getArticlePreviewContent())){
ArticleContent articleContent = articleMapper.selectArticleContent(article.getIdArticle());
Integer length = articleContent.getArticleContentHtml().length();
@ -186,7 +187,6 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
String articlePreviewContent = articleContent.getArticleContentHtml().substring(0,length);
article.setArticlePreviewContent(Html2TextUtil.getContent(articlePreviewContent));
}
}
return article;
}
}