From 2521b501c9a61227d82a46cb81aebd40d550e308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=A3=9E=E6=B4=8B?= <15778543+xufeiyang6017@user.noreply.gitee.com> Date: Fri, 23 Jan 2026 17:14:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=80=E5=87=BA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=90=8E=E9=A1=B5=E9=9D=A2=E5=88=B7=E6=96=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=92=8C=E7=99=BB=E5=BD=95=E6=88=90=E5=8A=9F=E5=90=8E?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E9=A6=96=E9=A1=B5=E5=AF=BC=E8=88=AA=E6=A0=8F?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.js | 8 +++++++- pages/profile/index.js | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pages/index/index.js b/pages/index/index.js index 24caf5d..32f3dee 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -468,7 +468,13 @@ Page({ // 检查用户手机号是否在personnel表中 checkPhoneInPersonnel() { - const userInfo = this.data.userInfo; + // 优先从本地存储获取最新的用户信息 + const localUserInfo = wx.getStorageSync('userInfo') || {}; + const app = getApp(); + const globalUserInfo = app.globalData.userInfo || {}; + + // 按优先级获取用户信息:本地存储 > 全局变量 > 页面数据 + const userInfo = localUserInfo.phoneNumber ? localUserInfo : (globalUserInfo.phoneNumber ? globalUserInfo : this.data.userInfo); const phoneNumber = userInfo.phoneNumber; if (!phoneNumber) { diff --git a/pages/profile/index.js b/pages/profile/index.js index 2ffdd04..563d046 100644 --- a/pages/profile/index.js +++ b/pages/profile/index.js @@ -1052,7 +1052,8 @@ Page({ userTags: [], needPhoneAuth: true, locationInfo: '', - hasLocationAuth: false + hasLocationAuth: false, + isInPersonnel: false }); wx.showToast({