fix: 内购类型为订阅时没有封面 url 导致报错的问题 (#3574)

This commit is contained in:
Henry Wang
2019-12-12 11:45:36 +08:00
committed by DIYgod
parent 6facba5abe
commit ce5601c30c
+4 -2
View File
@@ -41,13 +41,15 @@ module.exports = async (ctx) => {
item = iap.map((e) => {
const title = `${e.attributes.name} is now ${e.attributes.offers[0].priceFormatted}`;
return {
const result = {
link,
guid: e.attributes.url,
description: e.attributes.description.standard + `<br><img src=${e.attributes.artwork.url.replace('{w}x{h}{c}.{f}', '320x0w.jpg')}>`,
description: e.attributes.artwork ? e.attributes.description.standard + `<br><img src=${e.attributes.artwork.url.replace('{w}x{h}{c}.{f}', '320x0w.jpg')}>` : e.attributes.description.standard,
title,
pubDate: new Date().toUTCString(),
};
return result;
});
}