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

Method request

wxapp/wps.js:348–374  ·  view source on GitHub ↗
(method, url, options = {})

Source from the content-addressed store, hash-verified

346 }
347
348 async request(method, url, options = {}) {
349 await this.ensureLogin();
350 const res = await wpsRequest(method, url, {
351 ...options,
352 cookies: this.cookies,
353 secret: this.secret,
354 clockConfig: this.clockConfig,
355 });
356 this.cookies = res.cookies;
357 this.saveCache();
358 if (res.data?.msg === "empty wps_sid" || res.data?.result === "userNotLogin") {
359 if (!this.openid) throw new Error("WPS登录态失效,且缺少 openid 无法刷新");
360 $.log(`账号[${this.index}] WPS登录态失效,重新登录`);
361 this.removeLogin();
362 await this.login();
363 const retry = await wpsRequest(method, url, {
364 ...options,
365 cookies: this.cookies,
366 secret: this.secret,
367 clockConfig: this.clockConfig,
368 });
369 this.cookies = retry.cookies;
370 this.saveCache();
371 return retry.data;
372 }
373 return res.data;
374 }
375
376 async loadClockConfig() {
377 const res = await axios.get(ACTIVITY_CONFIG, {

Callers 6

userInfoMethod · 0.95
signMethod · 0.95
clockInfoMethod · 0.95
taskOutlineMethod · 0.95
lotteryTimesMethod · 0.95
doBrowseTaskMethod · 0.95

Calls 6

ensureLoginMethod · 0.95
saveCacheMethod · 0.95
removeLoginMethod · 0.95
loginMethod · 0.95
wpsRequestFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected