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

Method loginByWxCode

wxapp/parkson.js:169–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167 }
168
169 async loginByWxCode() {
170 try {
171 const code = await this.getLoginCode();
172 const data = await this.request({
173 apiPath: "/appLogin",
174 skipToken: true,
175 data: {
176 appType: 1,
177 principal: code,
178 },
179 });
180 this.applyToken(data);
181 this.saveCachedToken();
182 $.log(`账号[${this.index}] 登录成功: userId=${data.userId || ""}`);
183 } catch (e) {
184 $.log(`账号[${this.index}] 登录失败: ${e.message || e}`);
185 }
186 }
187
188 async checkToken() {
189 try {

Callers 1

runMethod · 0.95

Calls 5

getLoginCodeMethod · 0.95
requestMethod · 0.95
applyTokenMethod · 0.95
saveCachedTokenMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected