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

Method run

wxapp/nice.js:100–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98 }
99
100 async run() {
101 const cached = this.getCachedToken();
102 if (cached) {
103 this.applyToken(cached);
104 $.log(`账号[${this.index}] 使用缓存token`);
105 if (!(await this.checkToken())) {
106 this.removeCachedToken();
107 $.log(`账号[${this.index}] 缓存token失效,重新登录`);
108 }
109 }
110
111 if (!this.token) {
112 await this.loginByWxCode();
113 if (!this.token) return;
114 }
115
116 await this.getUser();
117 await this.getSignLog();
118 await this.doSign();
119 }
120
121 getCachedToken() {
122 const cache = readTokenCache();

Callers 1

nice.jsFile · 0.45

Calls 9

getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
getUserMethod · 0.95
getSignLogMethod · 0.95
doSignMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected