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

Method doSign

wxapp/parkson.js:243–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

241 }
242
243 async doSign() {
244 if (this.isTodaySign) {
245 $.log(`账号[${this.index}] 今日已签到`);
246 return;
247 }
248 try {
249 const date = (this.todayDate || formatDate()).replace(/-/g, "/");
250 const data = await this.request({
251 method: "GET",
252 apiPath: "/pointsSign/user/sign",
253 params: { date },
254 });
255 $.log(`账号[${this.index}] 签到成功: +${data?.signReward ?? "未知"}积分`);
256 } catch (e) {
257 const message = String(e.message || e);
258 if (/已签|重复|今日.*签/i.test(message)) {
259 $.log(`账号[${this.index}] 今日已签到`);
260 return;
261 }
262 $.log(`账号[${this.index}] 签到失败: ${message}`);
263 if (/token|登录|授权|401/i.test(message)) this.removeCachedToken();
264 }
265 }
266}
267
268!(async () => {

Callers 1

runMethod · 0.95

Calls 4

requestMethod · 0.95
removeCachedTokenMethod · 0.95
formatDateFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected