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

Method run

wxapp/roki.js:102–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

roki.jsFile · 0.45

Calls 11

getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
getUserInfoMethod · 0.95
signInMethod · 0.95
getRecentSignInMethod · 0.95
getMemberPointsMethod · 0.95
shortValueFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected