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

Method run

wxapp/mfd.js:98–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96 }
97
98 async run() {
99 const cached = this.getCachedToken();
100 if (cached) {
101 this.applyToken(cached);
102 $.log(`账号[${this.index}] 使用缓存登录态: memberId=${shortValue(this.memberId)}`);
103 if (!(await this.checkLogin())) {
104 this.removeCachedToken();
105 $.log(`账号[${this.index}] 缓存登录态失效,重新登录`);
106 }
107 }
108
109 if (!this.memberId) {
110 await this.loginByWxCode();
111 if (!this.memberId) return;
112 }
113
114 await this.getMemberInfo();
115 await this.getContinuousDays();
116 await this.signIn();
117 await this.getContinuousDays();
118 }
119
120 getCachedToken() {
121 const cache = readTokenCache();

Callers 1

mfd.jsFile · 0.45

Calls 10

getCachedTokenMethod · 0.95
applyTokenMethod · 0.95
checkLoginMethod · 0.95
removeCachedTokenMethod · 0.95
loginByWxCodeMethod · 0.95
getMemberInfoMethod · 0.95
getContinuousDaysMethod · 0.95
signInMethod · 0.95
shortValueFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected