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

Method run

wxapp/zbs.js:82–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80 }
81
82 async run() {
83 const cached = this.getCachedToken();
84 if (cached?.token) {
85 this.token = cached.token;
86 this.userInfo = cached.userInfo || {};
87 $.log(`账号[${this.index}] 使用缓存token: ${shortToken(this.token)}`);
88 if (!(await this.checkToken())) {
89 this.removeCachedToken();
90 $.log(`账号[${this.index}] 缓存token失效,重新登录`);
91 }
92 }
93
94 if (!this.token) {
95 await this.loginByWxCode();
96 if (!this.token) return;
97 }
98
99 await this.getPoints("当前");
100 await this.signIn();
101 await this.getPoints("签到后");
102 }
103
104 get userId() {
105 return this.userInfo?.userId || this.userInfo?.id || 1;

Callers 1

zbs.jsFile · 0.45

Calls 8

getCachedTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
getPointsMethod · 0.95
signInMethod · 0.95
shortTokenFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected