MCPcopy
hub / github.com/smallfawn/QLScriptPublic / run

Method run

wxapp/haitian.js:97–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95 }
96
97 async run() {
98 if (this.isLegacyToken) {
99 $.log(`账号[${this.index}] 检测到旧版 authorization#uuid 格式,先迁移到缓存`);
100 this.saveCachedToken();
101 } else {
102 const cached = this.getCachedToken();
103 if (cached?.accessToken) {
104 this.applyToken(cached);
105 $.log(`账号[${this.index}] 使用缓存token: ${shortToken(this.token)}`);
106 if (!(await this.checkToken())) {
107 this.removeCachedToken();
108 $.log(`账号[${this.index}] 缓存token失效,重新CODE登录`);
109 }
110 }
111
112 if (!this.token) {
113 await this.loginByWxCode();
114 if (!this.token) return;
115 }
116 }
117
118 await this.getUserInfo();
119 if (!this.userFlag) return;
120
121 await this.task_1();
122 await this.task_2();
123 await this.getSignActivity();
124
125 if (this.activity_code) {
126 await this.signIn();
127 await this.getLotteryTaskList();
128 await this.getLotteryNum();
129 }
130 }
131
132 cacheKey() {
133 return this.isLegacyToken ? this.accountId : this.raw;

Callers 1

haitian.jsFile · 0.45

Calls 15

saveCachedTokenMethod · 0.95
getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
getUserInfoMethod · 0.95
task_1Method · 0.95
task_2Method · 0.95
getSignActivityMethod · 0.95
signInMethod · 0.95
getLotteryTaskListMethod · 0.95

Tested by

no test coverage detected