From d4fe921568bc29d72644a55fd194adf7f9277cb5 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 22 十一月 2025 15:28:35 +0800
Subject: [PATCH] feat: 将旧系统数据同步到新系统

---
 app/App.vue |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/app/App.vue b/app/App.vue
index 0e788bc..86cbf17 100644
--- a/app/App.vue
+++ b/app/App.vue
@@ -3,6 +3,7 @@
   import store from '@/store'
   import { getToken } from '@/utils/auth'
   import { getUnreadCount } from '@/api/message'
+  import storage from '@/utils/storage'
 
   export default {
     data() {
@@ -14,6 +15,9 @@
     onLaunch: function() {
       this.lastToken = getToken()
       this.initApp()
+      
+      // 妫�鏌ュ苟娓呯悊瀛樺偍绌洪棿
+      this.checkStorage()
       
       // 鐩戝惉鐢ㄦ埛鐧诲綍浜嬩欢
       uni.$on('user-login', () => {
@@ -148,6 +152,34 @@
           clearInterval(this.messagePollingTimer)
           this.messagePollingTimer = null
         }
+      },
+      
+      // 妫�鏌ュ瓨鍌ㄧ┖闂�
+      checkStorage() {
+        try {
+          // 鑾峰彇瀛樺偍淇℃伅
+          const info = storage.getStorageInfo()
+          
+          if (info) {
+            const usagePercent = (info.currentSize / info.limitSize) * 100
+            console.log(`馃捑 瀛樺偍浣跨敤鎯呭喌: ${usagePercent.toFixed(2)}% (${info.currentSize}KB / ${info.limitSize}KB)`)
+            
+            // 濡傛灉浣跨敤瓒呰繃 80%锛岃嚜鍔ㄦ竻鐞�
+            if (usagePercent > 80) {
+              console.warn('鈿狅笍 瀛樺偍绌洪棿浣跨敤瓒呰繃 80%锛屽紑濮嬭嚜鍔ㄦ竻鐞�...')
+              storage.checkAndClean()
+              
+              // 鍐嶆妫�鏌�
+              const newInfo = storage.getStorageInfo()
+              if (newInfo) {
+                const newUsagePercent = (newInfo.currentSize / newInfo.limitSize) * 100
+                console.log(`鉁� 娓呯悊鍚庝娇鐢ㄦ儏鍐�: ${newUsagePercent.toFixed(2)}%`)
+              }
+            }
+          }
+        } catch (e) {
+          console.error('妫�鏌ュ瓨鍌ㄥけ璐�:', e)
+        }
       }
     }
   }

--
Gitblit v1.9.1