mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-19 04:29:45 +08:00
🚸 降低验证触发概率
This commit is contained in:
@@ -278,6 +278,7 @@ async function autoSign(ck: TGApp.App.Account.Cookie, ch?: string): Promise<void
|
||||
}
|
||||
await TGLogger.Script("[米游币任务]正在执行打卡");
|
||||
const ckSign = { stoken: ck.stoken, stuid: ck.stuid, mid: ck.mid };
|
||||
await painterReq.forum.recent(26, 2, 1, undefined, 20, ckSign);
|
||||
const resp = await apiHubReq.sign(ckSign, 2, ch);
|
||||
if (resp.retcode !== 0) {
|
||||
if (resp.retcode !== 1034) {
|
||||
|
||||
@@ -76,6 +76,7 @@ import TusOutput from "@comp/userScripts/tus-output.vue";
|
||||
import TusSign from "@comp/userScripts/tus-sign.vue";
|
||||
import apiHubReq from "@req/apiHubReq.js";
|
||||
import miscReq from "@req/miscReq.js";
|
||||
import painterReq from "@req/painterReq.js";
|
||||
import TSUserAccount from "@Sqlm/userAccount.js";
|
||||
import useUserStore from "@store/user.js";
|
||||
import { storeToRefs } from "pinia";
|
||||
@@ -135,6 +136,7 @@ async function tryCkVerify(): Promise<void> {
|
||||
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) {
|
||||
|
||||
@@ -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<string, string>} [cookie] 用户 Cookie
|
||||
* @return {Promise<TGApp.BBS.Forum.PostForumRes>}
|
||||
*/
|
||||
async function getRecentForumPostList(
|
||||
@@ -87,6 +88,7 @@ async function getRecentForumPostList(
|
||||
type: number = 1,
|
||||
lastId?: string,
|
||||
pageSize: number = 20,
|
||||
cookie?: Record<string, string>,
|
||||
): Promise<TGApp.BBS.Forum.PostForumRes> {
|
||||
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<TGApp.BBS.Forum.PostForumResp>(`${bapBu}getRecentForumPostList`, {
|
||||
method: "GET",
|
||||
query: params,
|
||||
headers: { cookie: "" },
|
||||
headers: { cookie: ck },
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user