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

Method doCheckin

wxapp/yunduodingding.js:243–267  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

runMethod · 0.95

Calls 3

requestMethod · 0.95
removeCachedTokenMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected