fix: 描述中出现undefined(#88)

This commit is contained in:
shanmite 2021-12-11 18:18:43 +08:00
parent 77d198bec5
commit 6851f29f75

View File

@ -75,10 +75,10 @@ function parseDynamicCard(dynamic_detail_card) {
obj.ctrl = (extend_json && strToJson(extend_json).ctrl) || []; obj.ctrl = (extend_json && strToJson(extend_json).ctrl) || [];
/* 是否有官方抽奖 */ /* 是否有官方抽奖 */
obj.hasOfficialLottery = extension && extension.lott && true; obj.hasOfficialLottery = extension && extension.lott && true;
/* 转发者的描述 后两个分别是视频动态的描述和视频本身的描述*/ /* 转发者的描述 纯文字内容 图片动态描述 后两个分别是视频动态的描述和视频本身的描述*/
obj.description = obj.description =
(item && (item.content + item.description)) (item && (item.content || '' + item.description || ''))
|| (cardToJson.dynamic + cardToJson.desc) || (cardToJson.dynamic || '' + cardToJson.desc || '')
|| ''; || '';
if (obj.type === 1) { if (obj.type === 1) {
const { origin_extension, origin } = cardToJson const { origin_extension, origin } = cardToJson
@ -98,8 +98,8 @@ function parseDynamicCard(dynamic_detail_card) {
obj.origin_uname = (user && (user.name || user.uname)) || ''; obj.origin_uname = (user && (user.name || user.uname)) || '';
/* 被转发者的描述 */ /* 被转发者的描述 */
obj.origin_description = obj.origin_description =
(item && (item.content + item.description)) (item && (item.content || '' + item.description || ''))
|| (originToJson.dynamic + originToJson.desc) || (originToJson.dynamic || '' + originToJson.desc || '')
|| ''; || '';
} }