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

Method run

wxapp/dasenlin.js:91–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89 }
90
91 async run() {
92 const cached = this.getCachedToken();
93 if (cached) {
94 this.applyToken(cached);
95 $.log(`账号[${this.index}] 使用缓存token`);
96 if (!(await this.checkToken())) {
97 this.removeCachedToken();
98 $.log(`账号[${this.index}] 缓存token失效,重新登录`);
99 }
100 }
101
102 if (!this.token) {
103 await this.loginByWxCode();
104 if (!this.token) return;
105 }
106
107 await this.getSignInfo();
108 await this.signIn();
109 await this.getSignInfo();
110 }
111
112 getCachedToken() {
113 const cache = readTokenCache();

Callers 1

dasenlin.jsFile · 0.45

Calls 8

getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
getSignInfoMethod · 0.95
signInMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected