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

Method run

wxapp/feihe.js:111–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

109 }
110
111 async run() {
112 const cached = this.getCachedToken();
113 if (cached) {
114 this.token = cached.token || "";
115 $.log(`账号[${this.index}] 使用缓存token: ${maskToken(this.token)}`);
116 if (!(await this.checkToken())) {
117 $.log(`账号[${this.index}] 缓存token失效,重新code登录`);
118 this.removeCachedToken();
119 this.token = "";
120 }
121 }
122
123 if (!this.token) {
124 await this.loginByCode();
125 }
126 if (!this.token) return;
127
128 await this.getIndexInfo();
129 await this.signIn();
130 }
131
132 getCachedToken() {
133 const cache = readCache();

Callers 1

feihe.jsFile · 0.45

Calls 8

getCachedTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByCodeMethod · 0.95
getIndexInfoMethod · 0.95
signInMethod · 0.95
maskTokenFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected