From 8cb24155196ef5a7a708299781cca86ff66a276c Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Thu, 16 Mar 2023 17:25:19 +0800 Subject: [PATCH] fix: return when no uid while init cache --- src/app/cache/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/cache/index.ts b/src/app/cache/index.ts index 07fed8b7..9560641a 100644 --- a/src/app/cache/index.ts +++ b/src/app/cache/index.ts @@ -53,6 +53,8 @@ const tables = [ ]; const initCache = () => { const uid = localStorage.getItem(KEY_UID) || ""; + // 没有uid,就没有本地缓存 + if (!uid) return; const name = `local_db_${uid}_v_${CACHE_VERSION.split(".").join("_")}`; window.CACHE = {}; tables.forEach(({ storeName, description }) => {