From 0fcb6eebefa5fd39ed6458ec9dacca38d40cdb17 Mon Sep 17 00:00:00 2001 From: 17792275749 <812100002@qq.com> Date: Mon, 24 Aug 2026 19:39:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(my):=20=E6=88=91=E7=9A=84=E9=A1=B5?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95=EF=BC=8C?= =?UTF-8?q?=E6=B8=85=E7=A9=BA=20lefu=20=E4=B8=8E=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- miniprogram/pages/my/my.ts | 18 ++++++++++++++++++ miniprogram/pages/my/my.wxml | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/miniprogram/pages/my/my.ts b/miniprogram/pages/my/my.ts index 8192164..c2bff82 100644 --- a/miniprogram/pages/my/my.ts +++ b/miniprogram/pages/my/my.ts @@ -1,5 +1,6 @@ import { calcAge } from '../../utils/idCard/index' import type { UserInfo } from '../../api/index' +import { leFuService } from '../../lefu/index' /** 页面展示用用户信息 */ interface PageUserInfo { @@ -45,6 +46,23 @@ Page({ wx.navigateTo({ url: '/pages/helpCenter/helpCenter' }) }, + // 退出登录:清空 lefu 连接与本地信息,回到登录页 + onLogout() { + wx.showModal({ + title: '退出登录', + content: '确定要退出登录吗?', + confirmText: '退出', + cancelText: '取消', + success: (res) => { + if (!res.confirm) return + leFuService.disconnect() + leFuService.stopScan() + wx.clearStorageSync() + wx.reLaunch({ url: '/pages/login/login' }) + }, + }) + }, + /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/miniprogram/pages/my/my.wxml b/miniprogram/pages/my/my.wxml index bcabdde..a6a4859 100644 --- a/miniprogram/pages/my/my.wxml +++ b/miniprogram/pages/my/my.wxml @@ -37,6 +37,6 @@ - 退出登录 + 退出登录 \ No newline at end of file