fix(route): increase genshin fetch limit (#11393)

This commit is contained in:
Tony 2022-12-07 00:08:55 +06:00 committed by GitHub
parent 343610998d
commit 642c7a07d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -43,12 +43,13 @@ const titles = {
module.exports = async (ctx) => {
const location = ctx.params.location ?? 'main';
const category = ctx.params.category ?? 'latest';
const limit = ctx.query.limit ? Number(ctx.query.limit) : 30;
const is_zh_CN = location === 'main';
const rootUrl = is_zh_CN
? `https://ys.mihoyo.com/content/ysCn/getContentList?pageSize=5&pageNum=1&channelId=${config[category][location]}`
: `https://genshin.mihoyo.com/content/yuanshen/getContentList?pageSize=5&pageNum=1&channelId=${config[category][location]}`;
? `https://ys.mihoyo.com/content/ysCn/getContentList?pageSize=${limit}&pageNum=1&channelId=${config[category][location]}`
: `https://genshin.mihoyo.com/content/yuanshen/getContentList?pageSize=${limit}&pageNum=1&channelId=${config[category][location]}`;
const response = await got(rootUrl);