fix(route): 东方财富研报被删除时的try catch (#12693)
* feat(route): add 东方财富研究报告 * feat(route): add 东方财富研究报告 * update: 东方财富研究报告文档 * feat(router): add 东方财富研究报告 * feat(router): add 东方财富研究报告 * fix:link add .jshtml suffix * feat(route):add 东方财富网行业研究 * chore: data link * fix(route): 东方财富研报被删除时的try catch * fix(route): 东方财富研报被删除时的try catch
This commit is contained in:
parent
658535de38
commit
56f6038f6f
|
|
@ -38,11 +38,15 @@ module.exports = async (ctx) => {
|
|||
const items = await Promise.all(
|
||||
list.map((item) =>
|
||||
ctx.cache.tryGet(item.link, async () => {
|
||||
const { data: response } = await got(item.link);
|
||||
const $ = cheerio.load(response);
|
||||
item.link = $('.pdf-link').attr('href');
|
||||
item.description = $('.ctx-content').text();
|
||||
return item;
|
||||
try {
|
||||
const { data: response } = await got(item.link);
|
||||
const $ = cheerio.load(response);
|
||||
item.link = $('.pdf-link').attr('href');
|
||||
item.description = $('.ctx-content').text();
|
||||
return item;
|
||||
} catch (error) {
|
||||
return item;
|
||||
}
|
||||
})
|
||||
)
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue