From 48771f57a0f475de4b0484be6ba84e0dadc3f058 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sat, 4 Oct 2025 12:09:17 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20=E9=99=8D=E4=BD=8E=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E8=A7=A6=E5=8F=91=E6=A6=82=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/userScripts/tus-mission.vue | 1 + src/pages/User/Scripts.vue | 2 ++ src/request/painterReq.ts | 14 +++++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/userScripts/tus-mission.vue b/src/components/userScripts/tus-mission.vue index e34201df..f68352fb 100644 --- a/src/components/userScripts/tus-mission.vue +++ b/src/components/userScripts/tus-mission.vue @@ -278,6 +278,7 @@ async function autoSign(ck: TGApp.App.Account.Cookie, ch?: string): Promise { let challenge: string | undefined = undefined; while (!flag) { await showLoading.start("正在验证CK有效性"); + await painterReq.forum.recent(26, 2, 1, undefined, 20, ck); const resp = await apiHubReq.sign(ck, 2, challenge); await showLoading.update(`[${resp.retcode}] ${resp.message}`); if (resp.retcode === -100) { diff --git a/src/request/painterReq.ts b/src/request/painterReq.ts index 1a669df4..36b4702e 100644 --- a/src/request/painterReq.ts +++ b/src/request/painterReq.ts @@ -1,7 +1,7 @@ /** * @file request/painterReq.ts * @description painter 下的请求 - * @since Beta v0.7.9 + * @since Beta v0.8.3 */ import { getRequestHeader } from "@utils/getRequestHeader.js"; import TGHttp from "@utils/TGHttp.js"; @@ -73,12 +73,13 @@ async function getHotForumPostList( /** * @description 获取最近版块帖子列表 - * @since Beta v0.7.9 + * @since Beta v0.8.3 * @param {number} forumId 版块 ID * @param {number} gid 社区 ID * @param {number} type 排序方式: 1-最新回复,2-最新发布 * @param {string} lastId 最后 ID * @param {number} pageSize 每页数量 + * @param {Record} [cookie] 用户 Cookie * @return {Promise} */ async function getRecentForumPostList( @@ -87,6 +88,7 @@ async function getRecentForumPostList( type: number = 1, lastId?: string, pageSize: number = 20, + cookie?: Record, ): Promise { type ReqParams = { forum_id: number; @@ -104,11 +106,17 @@ async function getRecentForumPostList( page_size: pageSize, }; if (lastId) params.last_id = lastId; + let ck: string = ""; + if (cookie) { + for (const key in cookie) { + ck += `${key}=${cookie[key]}; `; + } + } return ( await TGHttp(`${bapBu}getRecentForumPostList`, { method: "GET", query: params, - headers: { cookie: "" }, + headers: { cookie: ck }, }) ).data; }