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

Method loadCache

wxapp/wps.js:311–317  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

309 }
310
311 loadCache() {
312 const cache = this.getCached();
313 if (!this.openid && cache.openid) this.openid = cache.openid;
314 if (!this.secret && cache.secret) this.secret = cache.secret;
315 if (!Object.keys(this.cookies).length && cache.cookie) this.cookies = parseCookie(cache.cookie);
316 this.uid = this.cookies.uid || cache.uid || this.uid || "";
317 }
318
319 async login() {
320 if (!this.openid) throw new Error("缺少 openid,无法自动登录。可设置 wps=openid 或 wps=openid#Cookie");

Callers 1

ensureLoginMethod · 0.95

Calls 2

getCachedMethod · 0.95
parseCookieFunction · 0.85

Tested by

no test coverage detected