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

Method loginByWxCode

wxapp/longfor.js:433–454  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

431 }
432
433 async loginByWxCode() {
434 const checkData = {
435 appId: MINI_APP_ID,
436 thirdType: "WX_APPLET",
437 fingerprint: "",
438 authCode: await this.getLoginCode(),
439 };
440 const check = await this.miniPost(`${BASE_HOST}/mine/${API_VERSION}/publicApi/login/checkLoginType`, checkData);
441 const loginData = {
442 appId: MINI_APP_ID,
443 authCode: await this.getLoginCode(),
444 isNew: false,
445 thirdType: "WX_APPLET",
446 fingerprint: "",
447 ticket: check?.ticket || "",
448 };
449 const login = await this.miniPost(`${BASE_HOST}/mine/${API_VERSION}/publicApi/login/loginByMiniApp`, loginData);
450 this.applyToken(login);
451 if (!this.token) throw new Error(`登录响应未返回 token: ${JSON.stringify(login)}`);
452 this.saveCachedToken();
453 $.log(`账号[${this.index}] 登录成功: token=${shortValue(this.token)} lmid=${shortValue(this.lmid)}`);
454 }
455
456 findActivityNo(payload) {
457 return (JSON.stringify(payload || {}).match(/activity_no=([0-9]+)/) || [])[1] || "";

Callers 1

runMethod · 0.95

Calls 6

getLoginCodeMethod · 0.95
miniPostMethod · 0.95
applyTokenMethod · 0.95
saveCachedTokenMethod · 0.95
shortValueFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected