🎨 剔除主动推送百度 SEO 功能
This commit is contained in:
parent
f63ed152fc
commit
dff2145c0f
@ -199,30 +199,14 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(articleContentHtml)) {
|
||||
String previewContent;
|
||||
if (articleContentHtml.length() > MAX_PREVIEW) {
|
||||
previewContent = BaiDuAipUtils.getNewsSummary(newArticle.getArticleTitle(), articleContentHtml, MAX_PREVIEW);
|
||||
String previewContent = Html2TextUtil.getContent(articleContentHtml);
|
||||
if (previewContent.length() > MAX_PREVIEW) {
|
||||
previewContent = previewContent.substring(0, MAX_PREVIEW);
|
||||
}
|
||||
} else {
|
||||
previewContent = Html2TextUtil.getContent(articleContentHtml);
|
||||
}
|
||||
newArticle.setArticlePreviewContent(previewContent);
|
||||
}
|
||||
articleMapper.updateByPrimaryKeySelective(newArticle);
|
||||
|
||||
// 推送百度 SEO
|
||||
if (!ProjectConstant.ENV.equals(env)
|
||||
&& defaultStatus.equals(newArticle.getArticleStatus())
|
||||
&& articleContent.length() >= MAX_PREVIEW) {
|
||||
if (isUpdate) {
|
||||
BaiDuUtils.sendUpdateSEOData(newArticle.getArticlePermalink());
|
||||
} else {
|
||||
BaiDuUtils.sendSEOData(newArticle.getArticlePermalink());
|
||||
}
|
||||
}
|
||||
|
||||
map.put("id", newArticle.getIdArticle());
|
||||
return map;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
|
||||
/**
|
||||
* @author ronger
|
||||
*/
|
||||
@Component
|
||||
//@Component
|
||||
@Slf4j
|
||||
public class BaiDuCronTask {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user