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

Method run

wxapp/tmj.js:116–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114 }
115
116 async run() {
117 const cached = this.getCachedToken();
118 if (cached) {
119 this.applyToken(cached);
120 $.log(`账号[${this.index}] 使用缓存token`);
121 if (!(await this.checkToken())) {
122 this.removeCachedToken();
123 $.log(`账号[${this.index}] 缓存token失效,重新登录`);
124 }
125 }
126
127 if (!this.token) {
128 await this.loginByWxCode();
129 if (!this.token) return;
130 }
131
132 await this.ensureIntegralAccount();
133 await this.findSignActivity();
134 await this.loadSignInfo();
135 await this.doSign();
136 this.saveCachedToken();
137 }
138
139 getCachedToken() {
140 const cache = readTokenCache();

Callers 1

tmj.jsFile · 0.45

Calls 11

getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
ensureIntegralAccountMethod · 0.95
findSignActivityMethod · 0.95
loadSignInfoMethod · 0.95
doSignMethod · 0.95
saveCachedTokenMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected