feat: 接口错误处理增强,统一打印并展示后端错误信息
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
85523109f6
commit
8d69249147
@@ -101,8 +101,9 @@ Page({
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
wx.showToast({ title: '加载用户信息失败', icon: 'none' })
|
||||
.catch((err: any) => {
|
||||
console.error('[addUser] 加载用户信息失败:', err)
|
||||
wx.showToast({ title: err?.msg || err?.message || '加载用户信息失败', icon: 'none' })
|
||||
})
|
||||
},
|
||||
|
||||
@@ -378,8 +379,9 @@ Page({
|
||||
prevPage?._loadMembers?.()
|
||||
setTimeout(() => wx.navigateBack(), 1500)
|
||||
})
|
||||
.catch(() => {
|
||||
wx.showToast({ title: '添加失败,请重试', icon: 'none' })
|
||||
.catch((err: any) => {
|
||||
console.error('[addUser] 添加用户失败:', err)
|
||||
wx.showToast({ title: err?.msg || err?.message || '添加失败,请重试', icon: 'none' })
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user