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

Method run

wxapp/wugenvboshi.js:67–87  ·  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.token.accessToken || this.token.access_token)}`);
72 if (!(await this.checkToken())) {
73 this.removeCachedToken();
74 $.log(`账号[${this.index}] 缓存token失效,重新code登录`);
75 }
76 }
77
78 if (!this.token.accessToken && !this.token.access_token) {
79 await this.loginByWxCode();
80 }
81 if (!this.token.accessToken && !this.token.access_token) return;
82
83 await this.getPoints("签到前");
84 await this.getCheckinInfo();
85 await this.doCheckin();
86 await this.getPoints("签到后");
87 }
88
89 getCachedToken() {
90 const cache = readTokenCache();

Callers 1

wugenvboshi.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