From 99f18919b13cb7f4ff52b1a2ced120c6523b7d54 Mon Sep 17 00:00:00 2001 From: Jeason0228 <44083849+Jeason0228@users.noreply.github.com> Date: Tue, 24 Dec 2019 17:41:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=91=E6=95=B0=E6=B4=BE=20tag=20?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E4=B8=8D=E6=94=AF=E6=8C=81=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=20(#3626)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #3612 --- lib/routes/sspai/tag.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/routes/sspai/tag.js b/lib/routes/sspai/tag.js index f8323e9bc..6d337b6b6 100644 --- a/lib/routes/sspai/tag.js +++ b/lib/routes/sspai/tag.js @@ -3,8 +3,9 @@ const cheerio = require('cheerio'); module.exports = async (ctx) => { const keyword = ctx.params.keyword; - const api_url = `https://sspai.com/api/v1/articles?offset=0&limit=50&has_tag=1&tag=${keyword}&include_total=false`; - const host = `https://beta.sspai.com/tag/${keyword}`; + const keyword_encode = encodeURIComponent(keyword); + const api_url = `https://sspai.com/api/v1/articles?offset=0&limit=50&has_tag=1&tag=${keyword_encode}&include_total=false`; + const host = `https://beta.sspai.com/tag/${keyword_encode}`; const resp = await got({ method: 'get', url: api_url,