MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / doCheckin

Method doCheckin

wxapp/lvbizi.js:244–268  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

242 }
243
244 async doCheckin() {
245 if (!this.checkinId) {
246 $.log(`账号[${this.index}] 未获取到签到活动,跳过`);
247 return;
248 }
249 try {
250 const data = await this.request({
251 apiPath: "wscump/checkin/checkinV2.json",
252 query: { checkinId: this.checkinId },
253 });
254 const award = (data?.list || [])
255 .map((item) => item?.infos?.title || item?.infos?.desc || "")
256 .filter(Boolean)
257 .join(", ");
258 $.log(`账号[${this.index}] 签到成功: ${data?.desc || ""}${award ? ` ${award}` : ""}`);
259 } catch (e) {
260 const message = String(e.message || e);
261 if (/已签到|已经签到|重复|今日.*签|参与次数/.test(message)) {
262 $.log(`账号[${this.index}] 今日已签到`);
263 return;
264 }
265 $.log(`账号[${this.index}] 签到失败: ${message}`);
266 if (e.code === -1 || e.code === 40010 || e.code === 40009 || /登录|token|access/i.test(message)) this.removeCachedToken();
267 }
268 }
269}
270
271!(async () => {

Callers 1

runMethod · 0.95

Calls 3

requestMethod · 0.95
removeCachedTokenMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected