MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / signIn

Method signIn

wxapp/longfor.js:502–520  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

500 }
501
502 async signIn() {
503 await this.getPageConfig();
504 if (!this.activityNo) throw new Error("未在会员页配置中找到签到 activity_no");
505
506 const pageInfo = await this.getPageInfo();
507 $.log(`账号[${this.index}] 活动: ${pageInfo.task_name || "签到"} 今日=${this.todaySigned(pageInfo) ? "已签到" : "未签到"}`);
508 if (this.todaySigned(pageInfo)) return;
509
510 const dxToken = await getDxToken();
511 $.log(`账号[${this.index}] 风控指纹${dxToken ? "获取成功" : "获取失败,直接尝试"}`);
512
513 const result = await this.taskPost("/openapi/task/v1/signature/clock", { activity_no: this.activityNo }, dxToken);
514 if (!ok(result?.code)) {
515 const err = new Error(result?.message || result?.msg || JSON.stringify(result));
516 err.code = result?.code;
517 throw err;
518 }
519 $.log(`账号[${this.index}] 签到成功${this.rewardText(result?.data?.reward_info) ? `: ${this.rewardText(result.data.reward_info)}` : ""}`);
520 }
521
522 async run() {
523 const cached = this.getCachedToken();

Callers 1

runMethod · 0.95

Calls 8

getPageConfigMethod · 0.95
getPageInfoMethod · 0.95
todaySignedMethod · 0.95
taskPostMethod · 0.95
rewardTextMethod · 0.95
getDxTokenFunction · 0.85
okFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected