fix: BOOKWALKERTW、二柄APP图片显示错误 (#5999)

Co-authored-by: codefactor-io <support@codefactor.io>
Co-authored-by: Henry Wang <hi@henry.wang>
This commit is contained in:
wushijishan
2020-10-25 17:44:14 +00:00
committed by GitHub
co-authored by codefactor-io Henry Wang
parent 5ae2913e30
commit b5ca6d032b
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ module.exports = async (ctx) => {
list
.map((index, item) => {
item = $(item);
bookid = item.find('a').attr('href').substring(38, 43);
bookid = item.find('a').attr('href').split('/')[4];
return {
title: item.find('.bookname').text(),
description: `${item.find('.booknamesub').text()}&nbsp;|&nbsp;${item.find('.bprice').text()}<br><img src="https://image.bookwalker.com.tw/upload/product/${bookid}/zoom_big_${bookid}.jpg">`,
+2
View File
@@ -17,6 +17,8 @@ module.exports = async (ctx) => {
let description = item.content;
if (item.video_img !== null) {
description += `<br><img src="${item.video_img}">`;
} else if (item.acontent.indexOf('104129') !== -1) {
description += `<br><img src="${item.article.humb.split('?')[0]}">`;
} else {
const imgs = item.acontent.split(',');
for (let i = 0; i < imgs.length; i++) {