From de65f8ddd195efdfd57b8129e0692aa858906a43 Mon Sep 17 00:00:00 2001 From: Svend Date: Thu, 19 Apr 2018 16:34:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E9=A1=B5=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 16 ++-------------- router.js | 4 ---- routes/mzitu/README.md | 10 ---------- routes/mzitu/category.js | 5 +---- routes/mzitu/tag.js | 6 +----- 5 files changed, 4 insertions(+), 37 deletions(-) diff --git a/docs/README.md b/docs/README.md index 7dfc045ca..4390410a5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -324,24 +324,16 @@ number: 快递单号 #### 首页(最新) 举例: https://rss.now.sh/mzitu -举例2: https://rss.now.sh/mzitu/2 路由: `/mzitu/` -路由: `/mzitu/:page` - -参数: page,页码[可选,默认第一页] #### 分类 举例: https://rss.now.sh/mzitu/category/hot -举例2: https://rss.now.sh/mzitu/category/hot/3 路由: `/mzitu/category/:category` -路由: `/mzitu/category/:category/:page` -参数 -category,分类名 -page,页码[可选,默认第一页] +参数:category,分类名 | 热门 | 推荐 | 性感妹子 | 日本妹子 | 台湾妹子 | 清纯妹子 | | -------- | ------- | ---- | ------- | ------ | ------- | @@ -357,14 +349,10 @@ page,页码[可选,默认第一页] #### 专题详情 举例: https://rss.now.sh/mzitu/tag/shishen -举例2: https://rss.now.sh/mzitu/tag/shishen/2 路由: `/mzitu/tag/:tag` -路由: `/mzitu/tag/:tag/:page` -参数 -tag,专题名 `通过获取所有专题接口获取` -page,页码[可选,默认第一页] +参数: tag,专题名 `通过获取所有专题接口获取` #### 详情 diff --git a/router.js b/router.js index 29bd338d2..1ccc20873 100644 --- a/router.js +++ b/router.js @@ -53,12 +53,8 @@ router.get('/tieba/forum/:kw', require('./routes/tieba/forum')); // // 妹子图 router.get('/mzitu', require('./routes/mzitu/category')); router.get('/mzitu/tags', require('./routes/mzitu/tags')); -router.get('/mzitu/:page', require('./routes/mzitu/category')); router.get('/mzitu/category/:category', require('./routes/mzitu/category')); -router.get('/mzitu/category/:category/:page', require('./routes/mzitu/category')); router.get('/mzitu/post/:id', require('./routes/mzitu/post')); router.get('/mzitu/tag/:tag', require('./routes/mzitu/tag')); -router.get('/mzitu/tag/:tag/:page', require('./routes/mzitu/tag')); - module.exports = router; diff --git a/routes/mzitu/README.md b/routes/mzitu/README.md index 8fce98178..bd789efaf 100644 --- a/routes/mzitu/README.md +++ b/routes/mzitu/README.md @@ -3,24 +3,17 @@ #### 首页(最新) 举例: https://rss.now.sh/mzitu -举例2: https://rss.now.sh/mzitu/2 路由: `/mzitu/` -路由: `/mzitu/:page` - -参数: page,页码[可选,默认第一页] #### 分类 举例: https://rss.now.sh/mzitu/category/hot -举例2: https://rss.now.sh/mzitu/category/hot/3 路由: `/mzitu/category/:category` -路由: `/mzitu/category/:category/:page` 参数 category,分类名 -page,页码[可选,默认第一页] | 热门 | 推荐 | 性感妹子 | 日本妹子 | 台湾妹子 | 清纯妹子 | | -------- | ------- | ---- | ------- | ------ | ------- | @@ -36,14 +29,11 @@ page,页码[可选,默认第一页] #### 专题详情 举例: https://rss.now.sh/mzitu/tag/shishen -举例2: https://rss.now.sh/mzitu/tag/shishen/2 路由: `/mzitu/tag/:tag` -路由: `/mzitu/tag/:tag/:page` 参数 tag,专题名 `通过获取所有专题接口获取` -page,页码[可选,默认第一页] #### 详情 diff --git a/routes/mzitu/category.js b/routes/mzitu/category.js index 3c32ed708..cb85367ba 100644 --- a/routes/mzitu/category.js +++ b/routes/mzitu/category.js @@ -6,13 +6,10 @@ const config = require('../../config'); module.exports = async (ctx) => { let category = ctx.params.category; - let page = ctx.params.page; category = (category === undefined || category === 'undefined') ? '' : category; - page = (page === undefined || page === 'undefined') ? '' : `/page/${page}`; - - const url = `http://www.mzitu.com/${category}${page}`; + const url = `http://www.mzitu.com/${category}`; const response = await axios({ method: 'get', diff --git a/routes/mzitu/tag.js b/routes/mzitu/tag.js index bc828709c..ea52b6871 100644 --- a/routes/mzitu/tag.js +++ b/routes/mzitu/tag.js @@ -6,13 +6,9 @@ const config = require('../../config'); module.exports = async (ctx) => { let tag = ctx.params.tag; - let page = ctx.params.page; - tag = (tag === undefined || tag === 'undefined') ? '' : tag; - page = (page === undefined || page === 'undefined') ? '' : `/page/${page}`; - - const url = `http://www.mzitu.com/tag/${tag}${page}`; + const url = `http://www.mzitu.com/tag/${tag}`; const response = await axios({ method: 'get',