From 642c7a07d340e4dbfc8f0ad35a65338a5f1c15b9 Mon Sep 17 00:00:00 2001 From: Tony Date: Wed, 7 Dec 2022 00:08:55 +0600 Subject: [PATCH] fix(route): increase genshin fetch limit (#11393) --- lib/v2/mihoyo/ys/news.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/v2/mihoyo/ys/news.js b/lib/v2/mihoyo/ys/news.js index 6e4186797..cb13c6e85 100644 --- a/lib/v2/mihoyo/ys/news.js +++ b/lib/v2/mihoyo/ys/news.js @@ -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);