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({