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

Method run

wxapp/hrj.js:103–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101 }
102
103 async run() {
104 const cached = this.getCachedToken();
105 if (cached) {
106 this.session = cached;
107 $.log(`账号[${this.index}] 使用缓存token`);
108 if (!(await this.checkToken())) {
109 this.removeCachedToken();
110 $.log(`账号[${this.index}] 缓存token失效,重新登录`);
111 }
112 }
113
114 if (!this.session.token) {
115 await this.loginByWxCode();
116 if (!this.session.token) return;
117 }
118
119 await this.doSign();
120 this.saveCachedToken();
121 }
122
123 getCachedToken() {
124 const cache = readTokenCache();

Callers 1

hrj.jsFile · 0.45

Calls 7

getCachedTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
doSignMethod · 0.95
saveCachedTokenMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected