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

Method loginByOperateData

wxapp/fuyouhui.js:199–223  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197 }
198
199 async loginByOperateData() {
200 const op = await this.getOperateData();
201 const data = assertOk(
202 await request("post", "/usercenter/online/wxmp/registerWxUserInfo", {
203 data: {
204 code: op.code,
205 appChannel: "",
206 appKey: "WX_MINI_TC",
207 memberCode: "foryouclub_minipro_regs",
208 iv: op.iv,
209 encryptedData: op.encryptedData,
210 joinXingXuan: false,
211 },
212 }),
213 "自动授权"
214 );
215 const token = data.token || "";
216 if (!token) throw new Error(`自动授权未返回 token: ${JSON.stringify(data)}`);
217 this.token = token;
218 this.saveCache({
219 hasMobile: data.hasMobile,
220 fkMember: data.fkMember || "",
221 });
222 $.log(`账号[${this.index}] 自动授权成功: ${mask(token)}`);
223 }
224
225 ensureToken() {
226 if (!this.token) this.token = this.getCached().token || "";

Callers 1

runMethod · 0.95

Calls 6

getOperateDataMethod · 0.95
saveCacheMethod · 0.95
assertOkFunction · 0.70
requestFunction · 0.70
maskFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected