From 7ffa6b295c5e8dbae685f75ad2ba28fd4f2290d9 Mon Sep 17 00:00:00 2001 From: Ethan Shen <42264778+nczitzk@users.noreply.github.com> Date: Tue, 16 May 2023 00:59:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(route):=20=E6=97=A5=E6=9C=AC=E7=BB=8F?= =?UTF-8?q?=E6=B5=8E=E6=96=B0=E9=97=BB=E4=B8=AD=E6=96=87=E7=89=88=E6=96=B0?= =?UTF-8?q?=E9=97=BB=E5=85=A8=E6=96=87=20(#12515)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/v2/nikkei/cn/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/v2/nikkei/cn/index.js b/lib/v2/nikkei/cn/index.js index 2795c8c38..1c2c056b7 100644 --- a/lib/v2/nikkei/cn/index.js +++ b/lib/v2/nikkei/cn/index.js @@ -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]), [])