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

Method run

wxapp/parkson.js:68–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

parkson.jsFile · 0.45

Calls 9

getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
getPointsInfoMethod · 0.95
getSignListMethod · 0.95
doSignMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected