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,