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, }));