Repository navigation
fix: 修复 App 分页字段 list/items 不一致导致列表恒空 - #544
Merged
fastapiadmin merged 2 commits intoOct 22, 2026
Merged
Conversation
docs(readme): 中英文 README 徽章区统一 + 修复未闭合的 </a>
根因:后端 PageResultSchema 统一返回 items 字段,但 App 端 PageResult 类型与 useListPage 等消费点硬编码读取 list,导致工单评论、AI 会话、首页公告等既有列表页数据恒为空。 影响面:工单详情评论分页、AI 助手会话列表、首页公告,以及所有复用 useListPage 的通用列表页(工单列表、公告列表等)。 修复: - global.d.ts 的 PageResult<T> 字段 list → items,与后端对齐 - useListPage.ts 的 data 提取器改读 items - ticket-detail / chat / 首页 index 三处消费点 res.list → res.items
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根因
后端
PageResultSchema统一返回items字段(backend/app/core/base_schema.py),但 App 端PageResult<T>类型与useListPage等消费点硬编码读取list,导致工单评论、AI 会话、首页公告等既有列表页数据恒为空。影响面
ticket-detail)module_ai/chat)pages/index)useListPage的通用列表页(工单列表、公告列表等)改动
frontend/app/src/types/global.d.ts:PageResult<T>字段list→items,与后端对齐frontend/app/src/composables/useListPage.ts:data提取器改读itemsres.list→res.items(ticket-detail / chat / 首页 index)验证
pnpm run type-check通过pnpm exec eslint(涉及文件)通过注:
useMarketListPage.ts已按items实现,不在本次改动范围内。