Authored by 张帅

fix

... ... @@ -1368,6 +1368,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
private List<GrassArticleBlock> buildArticleBlock(String[] urls, Integer articleId, GrassArticleReq req ){
List<GrassArticleBlock> contentList = Lists.newArrayList();
int contentOrder =0;
Integer sort = Optional.ofNullable(req.getSort()).orElse(1);
long now = System.currentTimeMillis();
for (String url : urls) {
GrassArticleBlock content = new GrassArticleBlock();
... ... @@ -1379,7 +1380,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
contentOrder++;
contentList.add(content);
}
if(StringUtils.isNotEmpty(req.getContent()) && 3!=req.getSort()){
if(StringUtils.isNotEmpty(req.getContent()) && 3!=sort){
GrassArticleBlock content = new GrassArticleBlock();
content.setArticleId(articleId);
content.setContentData(getBlock(BLOCK_TEXT, req.getContent()));
... ... @@ -1389,7 +1390,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
contentList.add(content);
contentOrder++;
}
if(StringUtils.isNotEmpty(req.getActionUrl()) && 3==req.getSort()){
if(StringUtils.isNotEmpty(req.getActionUrl()) && 3==sort){
GrassArticleBlock content = new GrassArticleBlock();
content.setArticleId(articleId);
content.setContentData(getBlock(BLOCK_LINK, req.getActionUrl()));
... ...
... ... @@ -146,7 +146,12 @@
$("#authorUid").html(detailInfo.authorUid);
$("#nickName").html(detailInfo.nickName);
$("#sourceStr").html(detailInfo.sourceStr);
$("#content").html(detailInfo.articleContent == null || detailInfo.articleContent.length == 0 ? "空" : detailInfo.articleContent);
if(detailInfo.sort == '2'){
$("#content").html(detailInfo.articleContent == null || detailInfo.articleContent.length == 0 ? "空" : detailInfo.articleContent);
}
if(detailInfo.sort == '3'){
$("#content").html(detailInfo.actionUrl == null || detailInfo.actionUrl.length == 0 ? "空" : detailInfo.actionUrl);
}
$("#articleTitle").html(detailInfo.articleTitle);
$("#articleSubtitle").html(detailInfo.articleSubtitle);
... ...