From e2b85c76a4d0df0269104593a5438e00a789a10f Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Mon, 22 Jun 2026 18:39:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(bugcollect):=20=E4=BF=AE=E5=A4=8D=E8=B6=8B?= =?UTF-8?q?=E5=8A=BF=E5=9B=BE=E4=B8=8D=E6=98=BE=E7=A4=BA=20=E2=80=94=20API?= =?UTF-8?q?=20=E5=93=8D=E5=BA=94=E7=BB=93=E6=9E=84=E4=B8=BA=20{issueId,=20?= =?UTF-8?q?points[]}=20=E8=80=8C=E9=9D=9E=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit trend API 返回 { issueId, points: [...] },前端误以为是数组直接调用 .map() 导致 TypeError 被 catch 静默吞掉,图表从不渲染。 修复:正确读取 res.data.data.points,并更新类型定义。 Co-Authored-By: Claude Sonnet 4.6 --- tenant-platform/src/api/bugcollect.ts | 2 +- tenant-platform/src/views/bug-collect/BugCollectIssueDetail.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tenant-platform/src/api/bugcollect.ts b/tenant-platform/src/api/bugcollect.ts index c2ec334..1731ef0 100644 --- a/tenant-platform/src/api/bugcollect.ts +++ b/tenant-platform/src/api/bugcollect.ts @@ -162,7 +162,7 @@ export const bugCollectApi = { }, issueTrend(id: string | number, params?: { from?: string; to?: string }) { - return client.get<{ data: { date: string; count: number; affectedUsers: number }[] }>( + return client.get<{ data: { issueId: number; points: { date: string; count: number; affectedUsers: number }[] } }>( `/bugcollect/v1/issues/${id}/trend`, { params }, ) diff --git a/tenant-platform/src/views/bug-collect/BugCollectIssueDetail.vue b/tenant-platform/src/views/bug-collect/BugCollectIssueDetail.vue index ba9b0f9..6b60588 100644 --- a/tenant-platform/src/views/bug-collect/BugCollectIssueDetail.vue +++ b/tenant-platform/src/views/bug-collect/BugCollectIssueDetail.vue @@ -241,7 +241,7 @@ async function loadTrend() { if (!id || !trendChartRef.value) return try { const res = await bugCollectApi.issueTrend(id) - const trend = res.data.data + const trend = res.data.data?.points if (!trend || !trendChartRef.value) return if (!trendChart) trendChart = echarts.init(trendChartRef.value)