fix(route): 日本经济新闻中文版新闻全文 (#12515)
This commit is contained in:
@@ -30,7 +30,7 @@ module.exports = async (ctx) => {
|
||||
officialFeed = await parser.parseURL(currentUrl);
|
||||
items = officialFeed.items.slice(0, limit).map((item) => ({
|
||||
title: item.title,
|
||||
link: `${rootUrl}/x-columnviewpoint/${item.link.match(/\/([\d-]+\.html)/)[1]}`,
|
||||
link: new URL(item.attr('href'), rootUrl).href,
|
||||
}));
|
||||
} else {
|
||||
const response = await got({
|
||||
@@ -47,7 +47,7 @@ module.exports = async (ctx) => {
|
||||
|
||||
return {
|
||||
title: item.text(),
|
||||
link: `${rootUrl}/x-columnviewpoint/${item.attr('href').match(/\/([\d-]+\.html)/)[1]}`,
|
||||
link: new URL(item.attr('href'), currentUrl).href,
|
||||
};
|
||||
})
|
||||
.reduce((prev, cur) => (prev.length && prev[prev.length - 1].link === cur.link ? prev : [...prev, cur]), [])
|
||||
|
||||
Reference in New Issue
Block a user