From 3e44cd29eb8ac67f79e2bb6b1af9d8dc41963025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Thu, 30 Mar 2023 09:16:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=BC=A0=E6=9D=B0=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=87=BA=E7=8E=B0=E6=9C=80=E5=90=8E=E4=B8=80=E8=8A=82?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/course/index.tsx b/src/pages/course/index.tsx index 8c9951b..005013b 100644 --- a/src/pages/course/index.tsx +++ b/src/pages/course/index.tsx @@ -37,9 +37,11 @@ const CoursePage = () => { setTotalHours(res.data.hours[0]); } else if (res.data.chapters.length > 0) { const arr: any = []; - chapters.map((item: any) => { - arr.concat(res.data.hours[item.id]); - }); + for (let key in res.data.hours) { + res.data.hours[key].map((item: any) => { + arr.push(item); + }); + } setTotalHours(arr); } setLoading(false);