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

Method run

wxapp/fafa.js:86–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84 }
85
86 async run() {
87 if (!this.authorization) {
88 const cached = this.getCachedToken();
89 if (cached) {
90 this.applyToken(cached);
91 $.log(`账号[${this.index}] 使用缓存token`);
92 if (!(await this.checkToken())) {
93 this.removeCachedToken();
94 $.log(`账号[${this.index}] 缓存token失效,重新登录`);
95 }
96 }
97 }
98
99 if (!this.authorization) {
100 await this.loginByWxCode();
101 if (!this.authorization) return;
102 }
103
104 await this.getUserInfo();
105 await this.getPointsInfo();
106 await this.getSignList();
107 await this.doSign();
108 await this.getPointsInfo();
109 this.saveCachedToken();
110 }
111
112 cacheKey() {
113 return this.isDirectToken ? `token:${this.authorization.slice(-16)}` : this.account;

Callers 1

fafa.jsFile · 0.45

Calls 11

getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
getUserInfoMethod · 0.95
getPointsInfoMethod · 0.95
getSignListMethod · 0.95
doSignMethod · 0.95
saveCachedTokenMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected