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" >