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; }