MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / run

Method run

wxapp/longfor.js:522–541  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

520 }
521
522 async run() {
523 const cached = this.getCachedToken();
524 if (cached) {
525 this.applyToken(cached);
526 $.log(`账号[${this.index}] 使用缓存token: ${shortValue(this.token)}`);
527 if (!(await this.checkToken())) {
528 this.removeCachedToken();
529 $.log(`账号[${this.index}] 缓存token失效,重新登录`);
530 }
531 }
532 if (!this.token) await this.loginByWxCode();
533 if (!this.token) return;
534
535 try {
536 await this.signIn();
537 } catch (e) {
538 $.log(`账号[${this.index}] 签到失败${e.code ? `(${e.code})` : ""}: ${e.message || e}`);
539 if (tokenError(e)) this.removeCachedToken();
540 }
541 }
542}
543
544!(async () => {

Callers 1

longfor.jsFile · 0.45

Calls 9

getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
signInMethod · 0.95
tokenErrorFunction · 0.85
shortValueFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected