From fa5ea853099e88be253fca4fb2b0c2b7af5f396e Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 09 十一月 2025 15:57:04 +0800
Subject: [PATCH] feat:微信登录

---
 app/pages/index.vue |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/app/pages/index.vue b/app/pages/index.vue
index ea9ae6d..72efa8a 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -196,6 +196,13 @@
       }
     },
     onLoad() {
+      // 妫�鏌ョ敤鎴锋槸鍚﹀凡鐧诲綍
+      const userId = this.currentUser.userId
+      if (!userId) {
+        console.log('鐢ㄦ埛鏈櫥褰曪紝璺宠繃鍔犺浇鏁版嵁')
+        return
+      }
+      
       // 鍔犺浇鐢ㄦ埛缁戝畾杞﹁締淇℃伅
       this.loadUserVehicle()
       // 鍔犺浇姝e湪杩愯鐨勪换鍔�
@@ -204,6 +211,13 @@
       this.loadUnreadMessageCount()
     },
     onShow() {
+      // 妫�鏌ョ敤鎴锋槸鍚﹀凡鐧诲綍
+      const userId = this.currentUser.userId
+      if (!userId) {
+        console.log('鐢ㄦ埛鏈櫥褰曪紝璺宠繃鍔犺浇鏁版嵁')
+        return
+      }
+      
       // 姣忔鏄剧ず椤甸潰鏃跺埛鏂颁换鍔″垪琛ㄣ�佺粦瀹氳溅杈嗗拰娑堟伅鏁伴噺
       this.loadUserVehicle()
       this.loadRunningTasks()
@@ -246,6 +260,13 @@
       
       // 鍔犺浇鏈娑堟伅鏁伴噺
       loadUnreadMessageCount() {
+        // 妫�鏌ョ敤鎴锋槸鍚﹀凡鐧诲綍
+        const userId = this.currentUser.userId
+        if (!userId) {
+          console.log('鐢ㄦ埛鏈櫥褰曪紝璺宠繃鑾峰彇鏈娑堟伅鏁伴噺')
+          return
+        }
+        
         getUnreadCount().then(response => {
           if (response.code === 200) {
             this.unreadMessageCount = response.data || 0

--
Gitblit v1.9.1