From fe69a3055ad07b1e7b5989cc405b61287e98669e Mon Sep 17 00:00:00 2001 From: jjeejj Date: Tue, 8 May 2018 20:53:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 2 +- routes/toutiao/user.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/README.md b/docs/README.md index 0766dfa48..08ccba1b9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -516,7 +516,7 @@ key: 产品密钥 ### 独家号 -举例: [https://rss.now.sh/toutiao/user/:id](https://rss.now.sh/toutiao/user/:id) +举例: [https://rss.now.sh/toutiao/user/140544](https://rss.now.sh/toutiao/user/140544) 路由: `/toutiao/user/:id` diff --git a/routes/toutiao/user.js b/routes/toutiao/user.js index fdcbc4ee6..2b81de04d 100644 --- a/routes/toutiao/user.js +++ b/routes/toutiao/user.js @@ -4,10 +4,9 @@ const cheerio = require('cheerio'); const config = require('../../config'); const baseUrl = 'https://toutiao.io'; -let requestUrl = `${baseUrl}/subjects/userID?f=new` module.exports = async (ctx)=>{ const id = ctx.params.id; - requestUrl = requestUrl.replace('userID',id); + let requestUrl = `${baseUrl}/subjects/${id}?f=new`; const response = await axios({ method:'get', url:requestUrl,