fix(jike user): add default title (#115)

* fix(jike user): shorten title and add repost content

* fix #109

* add 'answer' type for jike user

fix title "undefined了: undefined" issue

* fix: screen name issue

* fix(jike user): add default title
This commit is contained in:
Derek 2018-05-14 14:13:50 +08:00 committed by DIYgod
parent 80ff059b63
commit 4043bcc0c9
1 changed files with 5 additions and 1 deletions

View File

@ -44,7 +44,11 @@ module.exports = async (ctx) => {
});
let content = item.content || item.linkInfo && item.linkInfo.title || item.target && item.target.content || item.question && item.question.title;
const shortenTitle = content.length > 75 ? `${content.substr(0, 75)}...` : content;
let shortenTitle = '一条动态';
if(content) {
shortenTitle = content.length > 75 ? `${content.substr(0, 75)}...` : content;
}
if (item.type === 'REPOST') {
const targetLinkMap = {