zhejiushizhuce hace 2 años
padre
commit
efe2a15239
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  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;