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

Method run

wxapp/colorful.js:108–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106 }
107
108 async run() {
109 if (this.isLegacyToken) {
110 $.log(`账号[${this.index}] 检测到旧版 token 格式,将仅用于迁移缓存`);
111 this.saveCachedToken();
112 } else {
113 const cached = this.getCachedToken();
114 if (cached?.token) {
115 this.applyToken(cached);
116 $.log(`账号[${this.index}] 使用缓存token: ${shortToken(this.token)}`);
117 if (!(await this.checkToken())) {
118 this.removeCachedToken();
119 $.log(`账号[${this.index}] 缓存token失效,重新尝试CODE登录`);
120 }
121 }
122
123 if (!this.token) {
124 await this.loginByWxCode();
125 if (!this.token) return;
126 }
127 }
128
129 await this.getUserInfo();
130 await this.getSignInfo();
131
132 if (this.signStatus) {
133 $.log(`账号[${this.index}] 今日已签到`);
134 return;
135 }
136 await this.signInV2();
137 }
138
139 cacheKey() {
140 return this.isLegacyToken ? this.accountId : this.raw;

Callers

nothing calls this directly

Calls 11

saveCachedTokenMethod · 0.95
getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
getUserInfoMethod · 0.95
getSignInfoMethod · 0.95
signInV2Method · 0.95
shortTokenFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected