From f384b6b56bcbf0951e849291c4a8cd4f66ba35b8 Mon Sep 17 00:00:00 2001 From: Ethan Shen <42264778+nczitzk@users.noreply.github.com> Date: Wed, 17 Aug 2022 14:29:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(route):=20=E6=96=97=E9=B1=BC=E8=B7=9F?= =?UTF-8?q?=E5=B8=96=E6=9C=80=E6=96=B0=E5=9B=9E=E5=A4=8D=20(#10504)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/v2/douyu/post.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/v2/douyu/post.js b/lib/v2/douyu/post.js index a10ed5c10..e892d0ea4 100644 --- a/lib/v2/douyu/post.js +++ b/lib/v2/douyu/post.js @@ -16,9 +16,16 @@ module.exports = async (ctx) => { }); const data = detailResponse.data.data; - const apiUrl = `${rootUrl}/wbapi/web/post/comments/${id}?group_id=${data.group_id}&sink=1&page=1`; + let apiUrl = `${rootUrl}/wbapi/web/post/comments/${id}?group_id=${data.group_id}&sink=1&page=1`; - const response = await got({ + let response = await got({ + method: 'get', + url: apiUrl, + }); + + apiUrl = `${rootUrl}/wbapi/web/post/comments/${id}?group_id=${data.group_id}&sink=1&page=${response.data.page_total}`; + + response = await got({ method: 'get', url: apiUrl, });