From 1f6a22a8d2f4b3a6864c4d5452623776a5ad098f Mon Sep 17 00:00:00 2001 From: junfengP <840282629@qq.com> Date: Sat, 15 Feb 2020 19:21:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20some=20bugs=20in=20=E8=89=B2=E8=8A=B1?= =?UTF-8?q?=E5=A0=82=20(#3968)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/dsndsht23/index.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/routes/dsndsht23/index.js b/lib/routes/dsndsht23/index.js index e3ff5c4314..d7c656f44c 100644 --- a/lib/routes/dsndsht23/index.js +++ b/lib/routes/dsndsht23/index.js @@ -21,18 +21,13 @@ const forumIdMaps = { module.exports = async (ctx) => { const subformName = ctx.params.subforumid || 'gqzwzm'; const subformId = subformName in forumIdMaps ? forumIdMaps[subformName] : subformName; - const typefilter = ctx.params.type ? `&filter=type&typeid=${ctx.params.type}` : ''; + const typefilter = ctx.params.type ? `&filter=typeid&typeid=${ctx.params.type}` : ''; const link = `${host}forum.php?mod=forumdisplay&fid=${subformId}${typefilter}`; const response = await got.get(link); const $ = cheerio.load(response.data); - const list = $('#threadlisttableid tbody') - .slice(1, 21) - .filter(function() { - // 去除置顶帖子和分割线 - const threadID = $(this).attr('id'); - return typeof threadID !== 'undefined' && threadID !== 'separatorline' && !threadID.startsWith('stickthread'); - }) + const list = $('#threadlisttableid tbody[id^=normalthread]') + .slice(0, 11) .map(function() { const info = { title: