perf: 优化缓存

This commit is contained in:
kuaifan 2022-12-10 13:40:46 +08:00
parent 529b8b682f
commit 0077925fc0

View File

@ -15,13 +15,10 @@ export default {
if (!initTag) { if (!initTag) {
await $A.IDBSet("initTag", true) await $A.IDBSet("initTag", true)
const userInfo = $A.getStorageJson("userInfo") const userInfo = $A.getStorageJson("userInfo")
const cacheServerUrl = $A.getStorageString("cacheServerUrl")
window.localStorage.clear()
if (userInfo.userid > 0) { if (userInfo.userid > 0) {
await $A.IDBSet("userInfo", userInfo) await $A.IDBSet("userInfo", userInfo)
} await $A.IDBSet("cacheServerUrl", $A.getStorageString("cacheServerUrl"))
if (/^https*:\/\//i.test(cacheServerUrl)) { window.localStorage.clear()
await $A.IDBSet("cacheServerUrl", cacheServerUrl)
} }
} }