diff --git a/routes/jike/user.js b/routes/jike/user.js index ecd2f226b..5e95cf710 100644 --- a/routes/jike/user.js +++ b/routes/jike/user.js @@ -29,7 +29,8 @@ module.exports = async (ctx) => { item: data.map((item) => { const typeMap = { 'ORIGINAL_POST': '发布', - 'REPOST': '转发' + 'REPOST': '转发', + 'ANSWER': '回答' }; let linkTemplate = ''; @@ -42,7 +43,7 @@ module.exports = async (ctx) => { imgTemplate += `
`; }); - let content = item.content || item.linkInfo && item.linkInfo.title || item.target && item.target.content; + 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; if (item.type === 'REPOST') { @@ -51,12 +52,15 @@ module.exports = async (ctx) => { 'ORIGINAL_POST': `https://web.okjike.com/post-detail/${item.target.id}/originalPost`, 'REPOST': `https://web.okjike.com/post-detail/${item.target.id}/repost` }; + + const screenNameTemplate = item.target.user ? `

@${item.target.user.screenName}

` : ''; + let repostImgTemplate = ''; item.target.pictures && item.target.pictures.forEach((item) => { repostImgTemplate += `

`; }); - let repostContent = `

@${item.target.user.screenName}

${item.target.content}${repostImgTemplate}
`; + let repostContent = `${screenNameTemplate}${item.target.content}${repostImgTemplate}`; content = `${content}${repostContent}`; }