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

Method run

wxapp/casetify.js:80–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78 }
79
80 async run() {
81 const cached = this.getCachedToken();
82 if (cached) {
83 this.applyToken(cached);
84 $.log(`账号[${this.index}] 使用缓存token`);
85 if (!(await this.checkToken())) {
86 this.removeCachedToken();
87 $.log(`账号[${this.index}] 缓存token失效,重新登录`);
88 }
89 }
90
91 if (!this.token) {
92 await this.loginByWxCode();
93 if (!this.token) return;
94 }
95
96 await this.getCampaignId();
97 await this.doSign();
98 this.saveCachedToken();
99 }
100
101 getCachedToken() {
102 const cache = readTokenCache();

Callers 1

casetify.jsFile · 0.45

Calls 9

getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
getCampaignIdMethod · 0.95
doSignMethod · 0.95
saveCachedTokenMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected