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

Method run

wxapp/sinsin.js:65–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63 }
64
65 async run() {
66 const cached = this.getCachedToken();
67 if (cached) {
68 this.token = cached;
69 $.log(`账号[${this.index}] 使用缓存session: ${maskToken(this.sessionId)}`);
70 if (!(await this.checkToken())) {
71 this.removeCachedToken();
72 $.log(`账号[${this.index}] 缓存session失效,重新code登录`);
73 }
74 }
75
76 if (!this.sessionId) await this.loginByWxCode();
77 if (!this.sessionId) return;
78
79 await this.getPoints("签到前");
80 await this.getCheckinInfo();
81 await this.doCheckin();
82 await this.getPoints("签到后");
83 }
84
85 getCachedToken() {
86 const cache = readTokenCache();

Callers 1

sinsin.jsFile · 0.45

Calls 9

getCachedTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
getPointsMethod · 0.95
getCheckinInfoMethod · 0.95
doCheckinMethod · 0.95
maskTokenFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected