zhejiushizhuce %!s(int64=2) %!d(string=hai) anos
pai
achega
efe2a15239
Modificáronse 1 ficheiros con 7 adicións e 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;