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

Method run

wxapp/iqoo.js:90–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88 }
89
90 async run() {
91 const cached = this.getCachedToken();
92 if (cached?.accessToken) {
93 this.applyToken(cached);
94 $.log(`账号[${this.index}] 使用缓存token: ${shortToken(this.token)}`);
95 if (!(await this.checkToken())) {
96 this.removeCachedToken();
97 $.log(`账号[${this.index}] 缓存token失效,重新登录`);
98 }
99 }
100
101 if (!this.token) {
102 await this.loginByWxCode();
103 if (!this.token) return;
104 }
105
106 await this.userInfoRequest();
107 await this.getTreadList();
108 if (this.threadId && this.postId) {
109 await this.likePost(this.threadId, this.postId);
110 await $.wait(5000);
111 await this.sharePost(this.threadId);
112 await $.wait(5000);
113 await this.viewPost(this.threadId);
114 await $.wait(5000);
115 await this.commonPost(this.threadId);
116 }
117 await this.getDrawNum();
118 await this.signIn();
119 }
120
121 getCachedToken() {
122 const cache = readTokenCache();

Callers 1

iqoo.jsFile · 0.45

Calls 15

getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkTokenMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
userInfoRequestMethod · 0.95
getTreadListMethod · 0.95
likePostMethod · 0.95
sharePostMethod · 0.95
viewPostMethod · 0.95
commonPostMethod · 0.95
getDrawNumMethod · 0.95

Tested by

no test coverage detected