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

Method loginByWxCode

wxapp/mengxiangjia.js:178–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176 }
177
178 async loginByWxCode() {
179 try {
180 const code = await this.getWxCode();
181 const data = await this.request({
182 method: "POST",
183 apiPath: "/appLogin",
184 needToken: false,
185 data: {
186 principal: code,
187 appType: 1,
188 },
189 });
190 this.loginResult = data || {};
191 this.saveCachedToken();
192 $.log(`账号[${this.index}] 登录成功: userId=${data?.userId || ""} token=${maskToken(this.accessToken)}`);
193 } catch (e) {
194 $.log(`账号[${this.index}] 登录失败: ${e.message || e}`);
195 }
196 }
197
198 async checkToken() {
199 try {

Callers 1

runMethod · 0.95

Calls 5

getWxCodeMethod · 0.95
requestMethod · 0.95
saveCachedTokenMethod · 0.95
maskTokenFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected