feat: 接口错误处理增强,统一打印并展示后端错误信息

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
17792275749
2026-09-01 16:57:28 +08:00
co-authored by Claude Sonnet 4.6
parent 85523109f6
commit 8d69249147
6 changed files with 31 additions and 20 deletions
+3 -2
View File
@@ -199,8 +199,9 @@ Page({
hasMore: allRecords.length < this.data.total,
})
})
.catch(() => {
wx.showToast({ title: '加载失败,请重试', icon: 'none' })
.catch((err: any) => {
console.error('[data] 加载历史数据失败:', err)
wx.showToast({ title: err?.msg || err?.message || '加载失败,请重试', icon: 'none' })
})
.finally(() => {
wx.hideLoading()