From 575893dbfabfdb8ca3f83d87ba2fb742e2b6ac8c Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 16 Apr 2018 17:18:50 +0800 Subject: [PATCH] remove useless `next()` in routes --- routes/bilibili/bangumi.js | 4 +--- routes/bilibili/coin.js | 4 +--- routes/bilibili/dynamic.js | 4 +--- routes/bilibili/fav.js | 4 +--- routes/bilibili/partion.js | 4 +--- routes/bilibili/video.js | 4 +--- routes/express/express.js | 4 +--- routes/jianshu/collection.js | 4 +--- routes/jianshu/home.js | 4 +--- routes/jianshu/monthly.js | 4 +--- routes/jianshu/user.js | 4 +--- routes/jianshu/weekly.js | 4 +--- routes/juejin/category.js | 4 +--- routes/ncm/artist.js | 4 +--- routes/ncm/playlist.js | 4 +--- routes/ncm/userplaylist.js | 4 +--- routes/weibo/user.js | 4 +--- routes/zhihu/collection.js | 4 +--- routes/ziroom/room.js | 4 +--- 19 files changed, 19 insertions(+), 57 deletions(-) diff --git a/routes/bilibili/bangumi.js b/routes/bilibili/bangumi.js index 6ca1b69636..c57559b98b 100644 --- a/routes/bilibili/bangumi.js +++ b/routes/bilibili/bangumi.js @@ -3,7 +3,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const seasonid = ctx.params.seasonid; const response = await axios({ @@ -29,6 +29,4 @@ module.exports = async (ctx, next) => { link: item.webplay_url })), }); - - next(); }; \ No newline at end of file diff --git a/routes/bilibili/coin.js b/routes/bilibili/coin.js index 28be444989..f06902b0ea 100644 --- a/routes/bilibili/coin.js +++ b/routes/bilibili/coin.js @@ -4,7 +4,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const uid = ctx.params.uid; const nameResponse = await axios({ @@ -42,6 +42,4 @@ module.exports = async (ctx, next) => { link: `https://www.bilibili.com/video/av${item.stat.aid}` })), }); - - next(); }; \ No newline at end of file diff --git a/routes/bilibili/dynamic.js b/routes/bilibili/dynamic.js index 1f4a24bac4..dfb570e696 100644 --- a/routes/bilibili/dynamic.js +++ b/routes/bilibili/dynamic.js @@ -3,7 +3,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const uid = ctx.params.uid; const response = await axios({ @@ -56,6 +56,4 @@ module.exports = async (ctx, next) => { }; }), }); - - next(); }; \ No newline at end of file diff --git a/routes/bilibili/fav.js b/routes/bilibili/fav.js index 2fe50dade9..94f769823d 100644 --- a/routes/bilibili/fav.js +++ b/routes/bilibili/fav.js @@ -4,7 +4,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const uid = ctx.params.uid; const nameResponse = await axios({ @@ -43,6 +43,4 @@ module.exports = async (ctx, next) => { link: `https://www.bilibili.com/video/av${item.aid}` })), }); - - next(); }; \ No newline at end of file diff --git a/routes/bilibili/partion.js b/routes/bilibili/partion.js index 76b88fde3b..e589e921a8 100644 --- a/routes/bilibili/partion.js +++ b/routes/bilibili/partion.js @@ -3,7 +3,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const tid = ctx.params.tid; const response = await axios({ @@ -33,6 +33,4 @@ module.exports = async (ctx, next) => { link: `https://www.bilibili.com/video/av${item.aid}` })), }); - - next(); }; \ No newline at end of file diff --git a/routes/bilibili/video.js b/routes/bilibili/video.js index 761e69ffa9..7245fe47a6 100644 --- a/routes/bilibili/video.js +++ b/routes/bilibili/video.js @@ -4,7 +4,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const uid = ctx.params.uid; const nameResponse = await axios({ @@ -43,6 +43,4 @@ module.exports = async (ctx, next) => { link: `https://www.bilibili.com/video/av${item.aid}` })), }); - - next(); }; \ No newline at end of file diff --git a/routes/express/express.js b/routes/express/express.js index a3f2b2b041..0ed128fc28 100644 --- a/routes/express/express.js +++ b/routes/express/express.js @@ -3,7 +3,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const company = ctx.params.company; const number = ctx.params.number; @@ -30,6 +30,4 @@ module.exports = async (ctx, next) => { link: item.context })), }); - - next(); }; \ No newline at end of file diff --git a/routes/jianshu/collection.js b/routes/jianshu/collection.js index 1afee4f8b7..b288f3b96d 100644 --- a/routes/jianshu/collection.js +++ b/routes/jianshu/collection.js @@ -4,7 +4,7 @@ const path = require('path'); const cheerio = require('cheerio'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const id = ctx.params.id; const response = await axios({ @@ -36,6 +36,4 @@ module.exports = async (ctx, next) => { }; }).get(), }); - - next(); }; \ No newline at end of file diff --git a/routes/jianshu/home.js b/routes/jianshu/home.js index 4b49045c19..720fe41675 100644 --- a/routes/jianshu/home.js +++ b/routes/jianshu/home.js @@ -4,7 +4,7 @@ const path = require('path'); const cheerio = require('cheerio'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const response = await axios({ method: 'get', url: 'https://www.jianshu.com', @@ -34,6 +34,4 @@ module.exports = async (ctx, next) => { }; }).get(), }); - - next(); }; \ No newline at end of file diff --git a/routes/jianshu/monthly.js b/routes/jianshu/monthly.js index 986bd48294..621c81f01f 100644 --- a/routes/jianshu/monthly.js +++ b/routes/jianshu/monthly.js @@ -4,7 +4,7 @@ const path = require('path'); const cheerio = require('cheerio'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const response = await axios({ method: 'get', url: 'https://www.jianshu.com/trending/monthly', @@ -34,6 +34,4 @@ module.exports = async (ctx, next) => { }; }).get(), }); - - next(); }; \ No newline at end of file diff --git a/routes/jianshu/user.js b/routes/jianshu/user.js index 6ad77062e7..94ff5fcd1c 100644 --- a/routes/jianshu/user.js +++ b/routes/jianshu/user.js @@ -4,7 +4,7 @@ const path = require('path'); const cheerio = require('cheerio'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const id = ctx.params.id; const response = await axios({ @@ -36,6 +36,4 @@ module.exports = async (ctx, next) => { }; }).get(), }); - - next(); }; \ No newline at end of file diff --git a/routes/jianshu/weekly.js b/routes/jianshu/weekly.js index ad26c9f5fd..1fcf2d890e 100644 --- a/routes/jianshu/weekly.js +++ b/routes/jianshu/weekly.js @@ -4,7 +4,7 @@ const path = require('path'); const cheerio = require('cheerio'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const response = await axios({ method: 'get', url: 'https://www.jianshu.com/trending/weekly', @@ -34,6 +34,4 @@ module.exports = async (ctx, next) => { }; }).get(), }); - - next(); }; \ No newline at end of file diff --git a/routes/juejin/category.js b/routes/juejin/category.js index a494630658..082a2a92de 100644 --- a/routes/juejin/category.js +++ b/routes/juejin/category.js @@ -3,7 +3,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const category = ctx.params.category; const idResponse = await axios({ @@ -45,6 +45,4 @@ module.exports = async (ctx, next) => { link: item.originalUrl })), }); - - next(); }; \ No newline at end of file diff --git a/routes/ncm/artist.js b/routes/ncm/artist.js index f72d972af4..1a8b7c5343 100644 --- a/routes/ncm/artist.js +++ b/routes/ncm/artist.js @@ -3,7 +3,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const id = ctx.params.id; const response = await axios({ @@ -31,6 +31,4 @@ module.exports = async (ctx, next) => { }; }), }); - - next(); }; \ No newline at end of file diff --git a/routes/ncm/playlist.js b/routes/ncm/playlist.js index 4b0e445a4c..663b50be9e 100644 --- a/routes/ncm/playlist.js +++ b/routes/ncm/playlist.js @@ -4,7 +4,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const id = ctx.params.id; const response = await axios({ @@ -36,6 +36,4 @@ module.exports = async (ctx, next) => { }; }), }); - - next(); }; \ No newline at end of file diff --git a/routes/ncm/userplaylist.js b/routes/ncm/userplaylist.js index de1dd3cbbc..0c0fc716ca 100644 --- a/routes/ncm/userplaylist.js +++ b/routes/ncm/userplaylist.js @@ -4,7 +4,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const uid = ctx.params.uid; const response = await axios({ @@ -40,6 +40,4 @@ module.exports = async (ctx, next) => { link: `http://music.163.com/playlist?id=${pl.id}` })) }); - - next(); }; \ No newline at end of file diff --git a/routes/weibo/user.js b/routes/weibo/user.js index 966b77edd4..051878d2ed 100644 --- a/routes/weibo/user.js +++ b/routes/weibo/user.js @@ -40,7 +40,7 @@ function format (status) { return temp; } -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const uid = ctx.params.uid; const containerResponse = await axios({ @@ -78,6 +78,4 @@ module.exports = async (ctx, next) => { }; }), }); - - next(); }; \ No newline at end of file diff --git a/routes/zhihu/collection.js b/routes/zhihu/collection.js index d232daefa9..4e0c3b33fa 100644 --- a/routes/zhihu/collection.js +++ b/routes/zhihu/collection.js @@ -4,7 +4,7 @@ const path = require('path'); const cheerio = require('cheerio'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const id = ctx.params.id; const response = await axios({ @@ -34,6 +34,4 @@ module.exports = async (ctx, next) => { }; }).get(), }); - - next(); }; \ No newline at end of file diff --git a/routes/ziroom/room.js b/routes/ziroom/room.js index b15b91626d..45f7bf7e53 100644 --- a/routes/ziroom/room.js +++ b/routes/ziroom/room.js @@ -4,7 +4,7 @@ const art = require('art-template'); const path = require('path'); const config = require('../../config'); -module.exports = async (ctx, next) => { +module.exports = async (ctx) => { const city = ctx.params.city || 'sh'; const keyword = ctx.params.keyword || ''; const iswhole = ctx.params.iswhole || 0; @@ -41,6 +41,4 @@ module.exports = async (ctx, next) => { link: `http://${domain}/${city.toUpperCase()}/room/${item.id}.html` })), }); - - next(); }; \ No newline at end of file