fix(route): javdb alternative domain (#7536)

This commit is contained in:
Ethan Shen
2021-08-26 23:03:48 +08:00
committed by GitHub
parent cda7861683
commit 09dffad27b
11 changed files with 86 additions and 71 deletions

View File

@@ -1,11 +1,12 @@
const utils = require('./utils');
module.exports = async (ctx) => {
ctx.params.filter = ctx.params.filter || '';
const id = ctx.params.id;
const filter = ctx.params.filter || '';
const currentUrl = `${utils.rootUrl}/makers/${ctx.params.id}?f=${ctx.params.filter}`;
const currentUrl = `/makers/${id}?f=${filter}`;
const filter = {
const filters = {
'': '',
playable: '可播放',
single: '單體作品',
@@ -14,7 +15,7 @@ module.exports = async (ctx) => {
preview: '預覽圖',
};
const title = `JavDB${filter[ctx.params.filter] === '' ? '' : ` - ${filter[ctx.params.filter]}`} `;
const title = `JavDB${filters[filter] === '' ? '' : ` - ${filters[filter]}`} `;
ctx.state.data = await utils.ProcessItems(ctx, currentUrl, title);
};