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

Method saveCache

wxapp/vipshop.js:252–266  ·  view source on GitHub ↗
(extra = {})

Source from the content-addressed store, hash-verified

250 }
251
252 saveCache(extra = {}) {
253 const cache = readCache();
254 cache[this.cacheKey] = {
255 ...(cache[this.cacheKey] || {}),
256 ...(this.openid ? { openid: this.openid } : {}),
257 ...(this.vipOpenid ? { vipOpenid: this.vipOpenid } : {}),
258 ...(this.unionid ? { unionid: this.unionid } : {}),
259 ...(this.token ? { token: this.token } : {}),
260 ...(this.userId ? { userId: this.userId } : {}),
261 marsCid: this.marsCid,
262 ...extra,
263 updatedAt: new Date().toISOString(),
264 };
265 writeCache(cache);
266 }
267
268 removeLoginCache() {
269 const cache = readCache();

Callers 2

ensureLoginMethod · 0.95
runMethod · 0.95

Calls 2

readCacheFunction · 0.70
writeCacheFunction · 0.70

Tested by

no test coverage detected