zhejiushizhuce 2 rokov pred
rodič
commit
efe2a15239
1 zmenil súbory, kde vykonal 7 pridanie a 1 odobranie
  1. 7 1
      src/utils/helpers.js

+ 7 - 1
src/utils/helpers.js

@@ -127,7 +127,13 @@ export const localStorageGet=(key,defaultValue="")=>{
     else
     {
         if (value.startsWith(head)){
-           value=decrypt(value.substring(head.length))
+            try {
+                value=decrypt(value.substring(head.length));
+            }
+            catch(err){
+                //如果出错返回空
+                value="";
+            }
         }
     }
     return value;