From cb64a21a338632d3fdeed08b25d1357d5a2d48b3 Mon Sep 17 00:00:00 2001 From: NiSen Date: Tue, 10 Oct 2023 20:45:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=95=E9=80=89=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useRequest.js | 2 +- src/views/courselibrary/CourseRecommended.vue | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/useRequest.js b/src/hooks/useRequest.js index 3c284468..15aacff4 100644 --- a/src/hooks/useRequest.js +++ b/src/hooks/useRequest.js @@ -28,7 +28,7 @@ const useTotalPage = (_url, params, config = {}) => { function fetch() { state.loading = true; return http[methods](unref(url), !s[1] ? unref(params) : { params: unref(params) }, { ...config }).then(r => { - state.data = r.data?.records || 0; + state.data = r.data?.records || []; state.total = r.data?.total || 0; state.loading = false; }) diff --git a/src/views/courselibrary/CourseRecommended.vue b/src/views/courselibrary/CourseRecommended.vue index 88dae806..17bcae30 100644 --- a/src/views/courselibrary/CourseRecommended.vue +++ b/src/views/courselibrary/CourseRecommended.vue @@ -67,6 +67,7 @@ :pagination="false" :row-selection="rowSelection" :scroll="{ x: 'max-content' }" + row-key="id" >