remove useless next() in routes

This commit is contained in:
DIYgod
2018-04-16 17:18:50 +08:00
parent 3f940a6906
commit 575893dbfa
19 changed files with 19 additions and 57 deletions

View File

@@ -3,7 +3,7 @@ const art = require('art-template');
const path = require('path'); const path = require('path');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const seasonid = ctx.params.seasonid; const seasonid = ctx.params.seasonid;
const response = await axios({ const response = await axios({
@@ -29,6 +29,4 @@ module.exports = async (ctx, next) => {
link: item.webplay_url link: item.webplay_url
})), })),
}); });
next();
}; };

View File

@@ -4,7 +4,7 @@ const art = require('art-template');
const path = require('path'); const path = require('path');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const uid = ctx.params.uid; const uid = ctx.params.uid;
const nameResponse = await axios({ const nameResponse = await axios({
@@ -42,6 +42,4 @@ module.exports = async (ctx, next) => {
link: `https://www.bilibili.com/video/av${item.stat.aid}` link: `https://www.bilibili.com/video/av${item.stat.aid}`
})), })),
}); });
next();
}; };

View File

@@ -3,7 +3,7 @@ const art = require('art-template');
const path = require('path'); const path = require('path');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const uid = ctx.params.uid; const uid = ctx.params.uid;
const response = await axios({ const response = await axios({
@@ -56,6 +56,4 @@ module.exports = async (ctx, next) => {
}; };
}), }),
}); });
next();
}; };

View File

@@ -4,7 +4,7 @@ const art = require('art-template');
const path = require('path'); const path = require('path');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const uid = ctx.params.uid; const uid = ctx.params.uid;
const nameResponse = await axios({ const nameResponse = await axios({
@@ -43,6 +43,4 @@ module.exports = async (ctx, next) => {
link: `https://www.bilibili.com/video/av${item.aid}` link: `https://www.bilibili.com/video/av${item.aid}`
})), })),
}); });
next();
}; };

View File

@@ -3,7 +3,7 @@ const art = require('art-template');
const path = require('path'); const path = require('path');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const tid = ctx.params.tid; const tid = ctx.params.tid;
const response = await axios({ const response = await axios({
@@ -33,6 +33,4 @@ module.exports = async (ctx, next) => {
link: `https://www.bilibili.com/video/av${item.aid}` link: `https://www.bilibili.com/video/av${item.aid}`
})), })),
}); });
next();
}; };

View File

@@ -4,7 +4,7 @@ const art = require('art-template');
const path = require('path'); const path = require('path');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const uid = ctx.params.uid; const uid = ctx.params.uid;
const nameResponse = await axios({ const nameResponse = await axios({
@@ -43,6 +43,4 @@ module.exports = async (ctx, next) => {
link: `https://www.bilibili.com/video/av${item.aid}` link: `https://www.bilibili.com/video/av${item.aid}`
})), })),
}); });
next();
}; };

View File

@@ -3,7 +3,7 @@ const art = require('art-template');
const path = require('path'); const path = require('path');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const company = ctx.params.company; const company = ctx.params.company;
const number = ctx.params.number; const number = ctx.params.number;
@@ -30,6 +30,4 @@ module.exports = async (ctx, next) => {
link: item.context link: item.context
})), })),
}); });
next();
}; };

View File

@@ -4,7 +4,7 @@ const path = require('path');
const cheerio = require('cheerio'); const cheerio = require('cheerio');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const id = ctx.params.id; const id = ctx.params.id;
const response = await axios({ const response = await axios({
@@ -36,6 +36,4 @@ module.exports = async (ctx, next) => {
}; };
}).get(), }).get(),
}); });
next();
}; };

View File

@@ -4,7 +4,7 @@ const path = require('path');
const cheerio = require('cheerio'); const cheerio = require('cheerio');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const response = await axios({ const response = await axios({
method: 'get', method: 'get',
url: 'https://www.jianshu.com', url: 'https://www.jianshu.com',
@@ -34,6 +34,4 @@ module.exports = async (ctx, next) => {
}; };
}).get(), }).get(),
}); });
next();
}; };

View File

@@ -4,7 +4,7 @@ const path = require('path');
const cheerio = require('cheerio'); const cheerio = require('cheerio');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const response = await axios({ const response = await axios({
method: 'get', method: 'get',
url: 'https://www.jianshu.com/trending/monthly', url: 'https://www.jianshu.com/trending/monthly',
@@ -34,6 +34,4 @@ module.exports = async (ctx, next) => {
}; };
}).get(), }).get(),
}); });
next();
}; };

View File

@@ -4,7 +4,7 @@ const path = require('path');
const cheerio = require('cheerio'); const cheerio = require('cheerio');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const id = ctx.params.id; const id = ctx.params.id;
const response = await axios({ const response = await axios({
@@ -36,6 +36,4 @@ module.exports = async (ctx, next) => {
}; };
}).get(), }).get(),
}); });
next();
}; };

View File

@@ -4,7 +4,7 @@ const path = require('path');
const cheerio = require('cheerio'); const cheerio = require('cheerio');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const response = await axios({ const response = await axios({
method: 'get', method: 'get',
url: 'https://www.jianshu.com/trending/weekly', url: 'https://www.jianshu.com/trending/weekly',
@@ -34,6 +34,4 @@ module.exports = async (ctx, next) => {
}; };
}).get(), }).get(),
}); });
next();
}; };

View File

@@ -3,7 +3,7 @@ const art = require('art-template');
const path = require('path'); const path = require('path');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const category = ctx.params.category; const category = ctx.params.category;
const idResponse = await axios({ const idResponse = await axios({
@@ -45,6 +45,4 @@ module.exports = async (ctx, next) => {
link: item.originalUrl link: item.originalUrl
})), })),
}); });
next();
}; };

View File

@@ -3,7 +3,7 @@ const art = require('art-template');
const path = require('path'); const path = require('path');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const id = ctx.params.id; const id = ctx.params.id;
const response = await axios({ const response = await axios({
@@ -31,6 +31,4 @@ module.exports = async (ctx, next) => {
}; };
}), }),
}); });
next();
}; };

View File

@@ -4,7 +4,7 @@ const art = require('art-template');
const path = require('path'); const path = require('path');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const id = ctx.params.id; const id = ctx.params.id;
const response = await axios({ const response = await axios({
@@ -36,6 +36,4 @@ module.exports = async (ctx, next) => {
}; };
}), }),
}); });
next();
}; };

View File

@@ -4,7 +4,7 @@ const art = require('art-template');
const path = require('path'); const path = require('path');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const uid = ctx.params.uid; const uid = ctx.params.uid;
const response = await axios({ const response = await axios({
@@ -40,6 +40,4 @@ module.exports = async (ctx, next) => {
link: `http://music.163.com/playlist?id=${pl.id}` link: `http://music.163.com/playlist?id=${pl.id}`
})) }))
}); });
next();
}; };

View File

@@ -40,7 +40,7 @@ function format (status) {
return temp; return temp;
} }
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const uid = ctx.params.uid; const uid = ctx.params.uid;
const containerResponse = await axios({ const containerResponse = await axios({
@@ -78,6 +78,4 @@ module.exports = async (ctx, next) => {
}; };
}), }),
}); });
next();
}; };

View File

@@ -4,7 +4,7 @@ const path = require('path');
const cheerio = require('cheerio'); const cheerio = require('cheerio');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const id = ctx.params.id; const id = ctx.params.id;
const response = await axios({ const response = await axios({
@@ -34,6 +34,4 @@ module.exports = async (ctx, next) => {
}; };
}).get(), }).get(),
}); });
next();
}; };

View File

@@ -4,7 +4,7 @@ const art = require('art-template');
const path = require('path'); const path = require('path');
const config = require('../../config'); const config = require('../../config');
module.exports = async (ctx, next) => { module.exports = async (ctx) => {
const city = ctx.params.city || 'sh'; const city = ctx.params.city || 'sh';
const keyword = ctx.params.keyword || ''; const keyword = ctx.params.keyword || '';
const iswhole = ctx.params.iswhole || 0; const iswhole = ctx.params.iswhole || 0;
@@ -41,6 +41,4 @@ module.exports = async (ctx, next) => {
link: `http://${domain}/${city.toUpperCase()}/room/${item.id}.html` link: `http://${domain}/${city.toUpperCase()}/room/${item.id}.html`
})), })),
}); });
next();
}; };