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

Method run

wxapp/wb.js:109–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107 }
108
109 async run() {
110 const cached = this.getCachedToken();
111 if (cached) {
112 this.applyToken(cached);
113 $.log(`账号[${this.index}] 使用缓存token`);
114 if (!(await this.checkToken())) {
115 this.removeCachedToken();
116 $.log(`账号[${this.index}] 缓存token失效,重新登录`);
117 }
118 }
119
120 if (!this.token) {
121 await this.loginByWxCode();
122 if (!this.token) return;
123 }
124
125 await this.getUser();
126 await this.signIn();
127 await this.doTargetTasks();
128 this.saveCachedToken();
129 }
130
131 getCachedToken() {
132 const cache = readTokenCache();

Callers 1

wb.jsFile · 0.45

Calls 10

getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
getUserMethod · 0.95
signInMethod · 0.95
doTargetTasksMethod · 0.95
saveCachedTokenMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected