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

Method getSignInfo

wxapp/dasenlin.js:236–265  ·  view source on GitHub ↗
(needLog = true)

Source from the content-addressed store, hash-verified

234 }
235
236 async getSignInfo(needLog = true) {
237 const data = await this.request({
238 base: SIGN_BASE,
239 apiPath: "/integralmall/signTemp/getByUser.do",
240 raw: true,
241 });
242 if (!isSuccess(data)) throw new Error(getMessage(data));
243 const result = data?.data?.result || data?.datas?.result || {};
244 this.signInfo = result;
245 const member = data?.data?.member || {};
246 const miniUser = data?.data?.miniUser || {};
247 const phone = this.userInfo.phone || this.userInfo.mobile || member.phone || member.mobile || miniUser.mobile || "";
248 this.userInfo = {
249 ...this.userInfo,
250 name: this.userInfo.name || member.name || miniUser.name || "",
251 phone,
252 mobile: phone,
253 tier: this.userInfo.tier || member.tier || miniUser.tier || "",
254 point: member.point ?? miniUser.point ?? this.userInfo.point ?? "",
255 };
256 this.saveCachedToken();
257
258 if (needLog) {
259 const userSign = result.userSign || {};
260 const signed = this.isSignedToday(userSign.signDate);
261 $.log(`账号[${this.index}] 会员: ${this.userInfo.name || "未知"} ${maskPhone(phone)}`);
262 $.log(`账号[${this.index}] 签到状态: 连续${userSign.signDay ?? userSign.successionDay ?? 0}天 今日=${signed ? "已签" : "未签"}`);
263 }
264 return result;
265 }
266
267 isSignedToday(signDate) {
268 if (!signDate) return false;

Callers 2

runMethod · 0.95
checkTokenMethod · 0.95

Calls 7

requestMethod · 0.95
saveCachedTokenMethod · 0.95
isSignedTodayMethod · 0.95
getMessageFunction · 0.85
isSuccessFunction · 0.70
maskPhoneFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected