新增置顶人功能,允许在小程序首页展示特定用户信息(昵称、头像)。更新相关 API 接口以支持获取和设置置顶人,优化用户体验。调整小程序页面以动态显示置顶人信息,确保一致性和可用性。

This commit is contained in:
Alex-larget
2026-03-20 15:58:18 +08:00
parent f7e7552eb1
commit 1b87fa92f7
12 changed files with 389 additions and 30 deletions

View File

@@ -85,6 +85,8 @@ App({
lastVipContactCheck: 0,
// 头像昵称检测上次检测时间戳onShow 节流 5 分钟
lastAvatarNicknameCheck: 0,
// 登录过期401 后用户点「去登录」时设为 true我的页 onShow 会检测并自动弹登录
pendingLoginAfterExpire: false,
},
@@ -875,7 +877,29 @@ App({
}
if (res.statusCode === 401) {
this.logout()
showError('未授权,请重新登录')
if (!silent) {
wx.showModal({
title: '登录已过期',
content: '请重新登录后继续使用',
confirmText: '去登录',
cancelText: '稍后',
success: (modalRes) => {
if (modalRes.confirm) {
const pages = getCurrentPages()
const cur = pages[pages.length - 1]
const route = (cur && cur.route) || ''
if (route === 'pages/my/my' && typeof cur.showLogin === 'function') {
cur.showLogin()
} else {
this.globalData.pendingLoginAfterExpire = true
wx.switchTab({ url: '/pages/my/my' })
}
}
}
})
} else {
showError('未授权,请重新登录')
}
reject(new Error('未授权'))
return
}