From 3a8ae57959efe309eed3d2ce5f7257767220700d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9C=B1?= <2671189764@qq.com> Date: Mon, 21 Apr 2025 17:50:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AB=AF=20=E9=80=80?= =?UTF-8?q?=E5=87=BA=E7=99=BB=E5=BD=95=E6=B8=85=E6=A5=9A=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ebike-maintenance/pages/user/mine/MePage.vue | 33 ++++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/ebike-maintenance/pages/user/mine/MePage.vue b/ebike-maintenance/pages/user/mine/MePage.vue index b8a71f4..c73808e 100644 --- a/ebike-maintenance/pages/user/mine/MePage.vue +++ b/ebike-maintenance/pages/user/mine/MePage.vue @@ -3,7 +3,7 @@ - + 昵称 @@ -22,7 +22,8 @@ - + @@ -34,7 +35,7 @@ } from 'vue'; import config from '@/utils/config'; const imgPath = config.imgPath; - + const menuItems = ref([{ @@ -78,6 +79,32 @@ link: '/pages/user/login/userLogout' } ]); + // 退出登录的方法 + const logout = () => { + uni.showModal({ + title: '退出登录', + content: '是否确认退出并清除缓存?', + success: function(res) { + if (res.confirm) { + // 清除缓存 + uni.clearStorage("wechat_user"); + + // 弹出成功提示 + uni.showToast({ + title: '退出成功', // 提示内容 + icon: 'success', // 图标类型 + duration: 2000 // 持续时间(单位:毫秒) + }); + + } else if (res.cancel) { + // 用户取消退出,做相应处理(可选) + console.log('用户取消退出'); + } + } + }); + } + + const navigateTo = (link) => {