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

Method loginByWxCode

wxapp/iqoo.js:227–249  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

225 }
226
227 async loginByWxCode() {
228 try {
229 const wxData = await this.getOperateData();
230 const payload = {
231 code: wxData.code,
232 encryptedData: wxData.encryptedData,
233 iv: wxData.iv,
234 from: 46,
235 };
236 const result = await this.request("v3/users/vivo/mini", payload);
237 const data = result?.Data || {};
238 const token = data.accessToken || data.token || "";
239 if (!token) throw new Error(`登录响应未返回token: ${JSON.stringify(result)}`);
240 this.token = token;
241 this.refreshToken = data.refreshToken || "";
242 this.userId = data.userId || data.uid || "";
243 this.userInfo = data.user || data;
244 this.saveCachedToken();
245 $.log(`账号[${this.index}] CODE登录成功: ${maskName(this.userInfo?.nickname || this.userInfo?.username || this.userId)}`);
246 } catch (e) {
247 $.log(`账号[${this.index}] CODE登录失败: ${e.message || e}`);
248 }
249 }
250
251 async checkToken() {
252 try {

Callers 1

runMethod · 0.95

Calls 5

getOperateDataMethod · 0.95
requestMethod · 0.95
saveCachedTokenMethod · 0.95
maskNameFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected