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

Method run

wxapp/aiguoyue.js:67–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

aiguoyue.jsFile · 0.45

Calls 10

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

Tested by

no test coverage detected