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

Method doCheckin

wxapp/sinsin.js:248–276  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

246 }
247
248 async doCheckin() {
249 if (!this.checkinId) {
250 $.log(`账号[${this.index}] 未获取到签到活动,跳过`);
251 return;
252 }
253 try {
254 const data = await this.request({
255 apiPath: "wscump/checkin/checkinV2.json",
256 query: { checkinId: this.checkinId },
257 });
258 const award = (data?.list || [])
259 .map((item) => item?.infos?.title || item?.infos?.desc || "")
260 .filter(Boolean)
261 .join(", ");
262 $.log(`账号[${this.index}] 签到成功: ${data?.desc || ""}${award ? ` ${award}` : ""}`);
263 } catch (e) {
264 const message = String(e.message || e);
265 if (/已签到|已经签到|重复|今日.*签|参与次数|最大参与次数/.test(message)) {
266 $.log(`账号[${this.index}] 今日已签到`);
267 return;
268 }
269 if (/手机号未授权|mobile.*authorized/i.test(message)) {
270 $.log(`账号[${this.index}] 签到失败: 用户手机号未授权,请先在小程序内完成手机号授权`);
271 return;
272 }
273 $.log(`账号[${this.index}] 签到失败: ${message}`);
274 if (e.code === -1 || e.code === 40010 || e.code === 40009 || /登录|token|session|access/i.test(message)) this.removeCachedToken();
275 }
276 }
277}
278
279!(async () => {

Callers 1

runMethod · 0.95

Calls 3

requestMethod · 0.95
removeCachedTokenMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected