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

Method sign

wxapp/ztkd.js:205–229  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

203 }
204
205 async sign() {
206 if (this.today?.isSigned) {
207 $.log("签到:今日已签到");
208 return;
209 }
210 const date = this.today?.date || formatDate(new Date());
211 const res = await this.api(
212 MEMBER_HOST,
213 "member/activity/signIn",
214 {
215 signType: "TODAY_SIGN",
216 signDate: `${date} 00:00:00`,
217 supplementaryScene: null,
218 },
219 true
220 );
221 if (res.status || res.success || res.result) {
222 const data = res.result || res.data || {};
223 $.log(`签到:成功,获得=${data.pointsEarned ?? "未知"}积分,奖励=${data.awardType || "未知"}`);
224 return;
225 }
226 const msg = res.message || res.errMessage || short(res);
227 if (/已签|重复|already/i.test(String(msg))) $.log(`签到:今日已签到,${msg}`);
228 else $.log(`签到:失败,${short(res)}`);
229 }
230
231 async run() {
232 $.log(`\n========== ${APP.name} 账号[${this.index}] ${this.account.remark || this.account.openid || "token"} ==========`);

Callers 1

runMethod · 0.95

Calls 4

apiMethod · 0.95
formatDateFunction · 0.70
shortFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected