From ef7f8f7329fab93f7a398618c488277a4bf3272f Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Wed, 22 Mar 2023 09:52:20 +0800
Subject: [PATCH] 取消关闭mock功能,所有mock走get,图片上传可以单独改地址走post

---
 common/LocalStorage.js |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/common/LocalStorage.js b/common/LocalStorage.js
index aacd37e..ecdbcb7 100644
--- a/common/LocalStorage.js
+++ b/common/LocalStorage.js
@@ -59,6 +59,17 @@
         return matches;
     }
 
+    // 清除本地存储工具保存的所有数据
+    cleanAll(){
+        const info = Taro.getStorageInfoSync();
+        const prefixReg = /^AiSim\.[a-zA-Z]+@/;
+        info.keys.forEach(storageKey => {
+            if (prefixReg.test(storageKey)) {
+                Taro.removeStorageSync(storageKey);
+            }
+        });
+    }
+
 }
 
 export const $localStorage = new LocalStorage();
\ No newline at end of file

--
Gitblit v1.9.1