zhejiushizhuce před 2 roky
rodič
revize
efe2a15239
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 7 1
      src/utils/helpers.js

+ 7 - 1
src/utils/helpers.js

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