From 6546c10fb8382fc19a1669b0019d4005bcc914e7 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Fri, 3 Nov 2023 18:21:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=94=B6=E8=97=8F?= =?UTF-8?q?=E5=A4=B9=E5=92=8C=E5=9B=9E=E6=94=B6=E7=AB=99=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=AF=8F=E9=A1=B5=E6=95=B0=E9=87=8F=E4=B8=8D=E7=94=9F=E6=95=88?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#2797)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/v1/favorite.go | 2 +- frontend/src/views/host/file-management/favorite/index.vue | 6 ++++-- .../src/views/host/file-management/recycle-bin/index.vue | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/app/api/v1/favorite.go b/backend/app/api/v1/favorite.go index 53253ee1c..5cd1d57fe 100644 --- a/backend/app/api/v1/favorite.go +++ b/backend/app/api/v1/favorite.go @@ -18,7 +18,7 @@ import ( // @Router /files/favorite/search [post] func (b *BaseApi) SearchFavorite(c *gin.Context) { var req dto.PageInfo - if err := helper.CheckBind(req, c); err != nil { + if err := helper.CheckBindAndValidate(&req, c); err != nil { return } total, list, err := favoriteService.Page(req) diff --git a/frontend/src/views/host/file-management/favorite/index.vue b/frontend/src/views/host/file-management/favorite/index.vue index fb4018bea..d22d409d4 100644 --- a/frontend/src/views/host/file-management/favorite/index.vue +++ b/frontend/src/views/host/file-management/favorite/index.vue @@ -18,12 +18,12 @@ import { reactive, ref } from 'vue'; const paginationConfig = reactive({ cacheSizeKey: 'favorite-page-size', currentPage: 1, - pageSize: 100, + pageSize: 20, total: 0, }); const req = reactive({ page: 1, - pageSize: 100, + pageSize: 20, }); const open = ref(false); const data = ref([]); @@ -40,6 +40,8 @@ const acceptParams = () => { const search = async () => { try { + req.page = paginationConfig.currentPage; + req.pageSize = paginationConfig.pageSize; const res = await SearchFavorite(req); data.value = res.data.items; paginationConfig.total = res.data.total; diff --git a/frontend/src/views/host/file-management/recycle-bin/index.vue b/frontend/src/views/host/file-management/recycle-bin/index.vue index c27f79140..bc55cdb53 100644 --- a/frontend/src/views/host/file-management/recycle-bin/index.vue +++ b/frontend/src/views/host/file-management/recycle-bin/index.vue @@ -55,7 +55,7 @@ import Delete from './delete/index.vue'; const open = ref(false); const req = reactive({ page: 1, - pageSize: 100, + pageSize: 20, }); const data = ref([]); const em = defineEmits(['close']); @@ -66,7 +66,7 @@ const files = ref([]); const paginationConfig = reactive({ cacheSizeKey: 'recycle-page-size', currentPage: 1, - pageSize: 100, + pageSize: 20, total: 0, }); @@ -87,6 +87,8 @@ const acceptParams = () => { const search = async () => { try { + req.page = paginationConfig.currentPage; + req.pageSize = paginationConfig.pageSize; const res = await getRecycleList(req); data.value = res.data.items; paginationConfig.total = res.data.total;