diff --git a/src/components/Post/PostListView.vue b/src/components/Post/PostListView.vue index 29ba4cc0..475a27ee 100644 --- a/src/components/Post/PostListView.vue +++ b/src/components/Post/PostListView.vue @@ -548,6 +548,11 @@ export default { const { categoryId } = this.list.params this.list.params.categoryId = categoryId === 0 ? undefined : categoryId const response = await apiClient.post.list(this.list.params) + if (response.data.content.length === 0 && this.list.params.page > 0) { + this.list.params.page-- + await this.handleListPosts() + return + } this.list.data = response.data.content this.list.total = response.data.total diff --git a/src/views/attachment/AttachmentList.vue b/src/views/attachment/AttachmentList.vue index 55b4de85..040a44b5 100644 --- a/src/views/attachment/AttachmentList.vue +++ b/src/views/attachment/AttachmentList.vue @@ -254,6 +254,11 @@ export default { const response = await apiClient.attachment.list(this.list.params) + if (response.data.content.length === 0 && this.list.params.page > 0) { + this.list.params.page-- + await this.handleListAttachments() + return + } this.list.data = response.data.content this.list.total = response.data.total this.list.hasNext = response.data.hasNext diff --git a/src/views/comment/components/CommentTab.vue b/src/views/comment/components/CommentTab.vue index 9e42ce49..2705734e 100644 --- a/src/views/comment/components/CommentTab.vue +++ b/src/views/comment/components/CommentTab.vue @@ -533,6 +533,11 @@ export default { this.list.loading = true const response = await apiClient.comment.list(this.targetName, this.list.params) + if (response.data.content.length === 0 && this.list.params.page > 0) { + this.list.params.page-- + await this.handleListComments() + return + } this.list.data = response.data.content this.list.total = response.data.total diff --git a/src/views/sheet/components/CustomSheetList.vue b/src/views/sheet/components/CustomSheetList.vue index 31a6833c..390b63f5 100644 --- a/src/views/sheet/components/CustomSheetList.vue +++ b/src/views/sheet/components/CustomSheetList.vue @@ -369,7 +369,11 @@ export default { } const { data } = await apiClient.sheet.list(this.list.params) - + if (data.content.length === 0 && this.list.params.page > 0) { + this.list.params.page-- + await this.handleListSheets() + return + } this.list.data = data.content this.list.total = data.total this.list.hasPrevious = data.hasPrevious diff --git a/src/views/sheet/independent/JournalList.vue b/src/views/sheet/independent/JournalList.vue index 6c1be9b0..75867df0 100644 --- a/src/views/sheet/independent/JournalList.vue +++ b/src/views/sheet/independent/JournalList.vue @@ -265,6 +265,11 @@ export default { this.list.loading = true const { data } = await apiClient.journal.list(this.list.params) + if (data.content.length === 0 && this.list.params.page > 0) { + this.list.params.page-- + await this.handleListJournals() + return + } this.list.data = data.content this.list.total = data.total diff --git a/src/views/system/developer/tabs/OptionsList.vue b/src/views/system/developer/tabs/OptionsList.vue index 179408a0..7231b245 100644 --- a/src/views/system/developer/tabs/OptionsList.vue +++ b/src/views/system/developer/tabs/OptionsList.vue @@ -227,6 +227,11 @@ export default { apiClient.option .listAsView(this.queryParam) .then(response => { + if (response.data.content.length === 0 && this.pagination.page > 0) { + this.pagination.page-- + this.handleListOptions() + return + } this.options = response.data.content this.pagination.total = response.data.total })