From cac9a78f0c582fee29d4841d62fd060185f151d2 Mon Sep 17 00:00:00 2001
From: lld <15027638633@163.com>
Date: Thu, 26 Mar 2026 19:31:59 +0800
Subject: [PATCH] =?UTF-8?q?=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95=E4=BD=8D?=
=?UTF-8?q?=E7=BD=AE=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/mine/index.vue | 20 ++++++++++++++++++++
pages/mine/subpages/setting/index.vue | 21 +--------------------
2 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/pages/mine/index.vue b/pages/mine/index.vue
index be614d8..4542262 100644
--- a/pages/mine/index.vue
+++ b/pages/mine/index.vue
@@ -84,6 +84,7 @@
+
@@ -141,6 +142,19 @@
},
handleBuilding() {
this.$modal.showToast('模块建设中~')
+ },
+ handleLogout() {
+ this.$modal.confirm('确定注销并退出系统吗?').then(() => {
+ this.$store.dispatch('LogOut').then(() => {
+ // ========== 新增:登出时断开MQTT并清空状态 ==========
+ // 1. 获取全局App实例
+ const app = getApp()
+ // 2. 调用App.vue的logout方法(断开MQTT+清空订阅列表)
+ app.logout()
+ }).finally(()=>{
+ this.$tab.reLaunch('/pages/index')
+ })
+ })
}
}
}
@@ -220,4 +234,10 @@
/* 或者写成 border: 0 !important; */
}
}
+
+ .logout {
+ margin: 25rpx;
+ background: #4e84f2;
+ color: #fff;
+ }
diff --git a/pages/mine/subpages/setting/index.vue b/pages/mine/subpages/setting/index.vue
index a3ea46c..02c9a73 100644
--- a/pages/mine/subpages/setting/index.vue
+++ b/pages/mine/subpages/setting/index.vue
@@ -20,13 +20,6 @@
-
@@ -47,19 +40,7 @@
handleCleanTmp() {
this.$modal.showToast('模块建设中~')
},
- handleLogout() {
- this.$modal.confirm('确定注销并退出系统吗?').then(() => {
- this.$store.dispatch('LogOut').then(() => {
- // ========== 新增:登出时断开MQTT并清空状态 ==========
- // 1. 获取全局App实例
- const app = getApp()
- // 2. 调用App.vue的logout方法(断开MQTT+清空订阅列表)
- app.logout()
- }).finally(()=>{
- this.$tab.reLaunch('/pages/index')
- })
- })
- }
+
}
}