From e19ba8e1450f78b16894e74b1c45786085f5a0c7 Mon Sep 17 00:00:00 2001
From: liangbin <15536829364@163.com>
Date: Tue, 3 Feb 2026 10:00:56 +0800
Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E6=88=B7=E9=A1=B5=E9=9D=A2):=20?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E5=B9=B6=E7=A7=BB=E9=99=A4=E9=A1=B9=E7=9B=AE=E5=AD=98?=
=?UTF-8?q?=E6=A1=A3=E5=85=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
添加退出登录功能实现,包括确认弹窗和清除token操作
移除不再使用的项目存档入口代码
---
src/pages/user/index.vue | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/src/pages/user/index.vue b/src/pages/user/index.vue
index cf2bc9c..c669f85 100644
--- a/src/pages/user/index.vue
+++ b/src/pages/user/index.vue
@@ -16,13 +16,13 @@
消息中心
-
+
- 退出登录
+ 退出登录
@@ -47,6 +47,27 @@ const toArchivesRoom = () => {
})
}
+// 退出登录
+const logout = () => {
+ uni.showModal({
+ title: '提示',
+ content: '确定退出登录吗?',
+ success: (res) => {
+ if (res.confirm) {
+ // 执行退出登录操作
+ uni.removeStorageSync('token')
+ uni.showToast({
+ title: '退出登录成功',
+ icon: 'success',
+ })
+ uni.reLaunch({
+ url: '/pages/login/index',
+ })
+ }
+ }
+ })
+}
+//