Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/app/src/composables/useListPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export function useListPage<T, AG extends AlovaGenerics = AlovaGenerics>(options
watchingStates: [],
preloadNextPage: false,
preloadPreviousPage: false,
// 响应已由 http 层 responded 解包为业务结构 { list, total }
data: res => (res as PageResult<T>).list ?? [],
// 响应已由 http 层 responded 解包为业务结构 { items, total }
data: res => (res as PageResult<T>).items ?? [],
total: res => (res as PageResult<T>).total ?? 0,
},
)
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/src/pages/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ async function loadData() {
async function loadNotices() {
try {
const res = await NoticeAPI.getPage({ page_no: 1, page_size: 3, status: 1 })
recentNotices.value = res.list || []
recentNotices.value = res.items || []
}
catch { /* silent */ }
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/src/subPages/module_ai/chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function loadSessions() {
loading.value = true
try {
const res = await ChatAPI.getSessions()
sessions.value = res.list || []
sessions.value = res.items || []
}
catch {
sessions.value = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async function loadComments() {
return
try {
const res = await TicketAPI.getComments(ticketId.value, { page_no: commentPage.page_no, page_size: commentPage.page_size })
comments.value = res.list || []
comments.value = res.items || []
commentTotal.value = res.total || 0
}
catch (e) {
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ declare global {
* 分页响应对象(列表接口 `data` 统一为该结构)
*/
interface PageResult<T = any> {
/** 数据列表 */
list: T[]
/** 数据列表(后端 PageResultSchema 统一返回 items,而非 list) */
items: T[]
/** 总数 */
total: number
page_no?: number
Expand Down
Loading