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

Method run

wxapp/gyjj.js:81–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79 }
80
81 async run() {
82 if (this.isLegacyToken) {
83 $.log(`账号[${this.index}] 检测到旧版token格式,先迁移到缓存`);
84 this.saveCachedToken();
85 } else {
86 const cached = this.getCachedToken();
87 if (cached?.token) {
88 this.applyToken(cached);
89 $.log(`账号[${this.index}] 使用缓存token: ${shortToken(this.token)}`);
90 if (!(await this.checkToken())) {
91 this.removeCachedToken();
92 $.log(`账号[${this.index}] 缓存token失效,重新CODE登录`);
93 }
94 }
95
96 if (!this.token) {
97 await this.loginByWxCode();
98 if (!this.token) return;
99 }
100 }
101
102 await this.sign();
103 await this.account();
104 }
105
106 cacheKey() {
107 return this.isLegacyToken ? this.accountId : this.raw;

Callers 1

gyjj.jsFile · 0.45

Calls 10

saveCachedTokenMethod · 0.95
getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
signMethod · 0.95
accountMethod · 0.95
shortTokenFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected