From 89788a64709fbeaf68c52c9a4ac9c621cf81d3f2 Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 22 Jan 2024 17:31:53 +0000 Subject: [PATCH] fix(route): huanqiu (#14304) --- lib/v2/huanqiu/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/v2/huanqiu/index.js b/lib/v2/huanqiu/index.js index d088c288ad2f2e..8a45cc6d210a8f 100644 --- a/lib/v2/huanqiu/index.js +++ b/lib/v2/huanqiu/index.js @@ -20,26 +20,26 @@ module.exports = async (ctx) => { throw new Error('Invalid category'); } - const host = 'https://' + category + '.huanqiu.com'; + const host = `https://${category}.huanqiu.com`; const resp = await got({ method: 'get', - url: [...host, '/api/channel_pc'], + url: `${host}/api/channel_pc`, }).json(); const name = getKeysRecursive(resp.children, 'children', 'domain_name', [])[0]; const nodes = getKeysRecursive(resp.children, 'children', 'node', []) - .map((x) => '"' + x + '"') + .map((x) => `"${x}"`) .join(','); const req = await got({ method: 'get', - url: [...host, '/api/list?node='] + nodes + `&offset=0&limit=${ctx.query.limit ?? 20}`, + url: `${host}/api/list?node=${nodes}&offset=0&limit=${ctx.query.limit ?? 20}`, }).json(); let items = req.list .filter((item) => item.aid) .map((item) => ({ - link: host + '/article/' + item.aid, + link: `${host}/article/${item.aid}`, title: item.title, }));