From 70f89714df20bf484b4182bc5db72ef8b3b63fb0 Mon Sep 17 00:00:00 2001 From: hy Date: Thu, 22 Jan 2026 15:47:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B1=BB=E5=9E=8B=E5=A4=84=E7=90=86):=20?= =?UTF-8?q?=E5=B0=86ChunkListItem=E7=9A=84vector=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=8F=AF=E9=80=89=E5=B9=B6=E7=A7=BB=E9=99=A4?= =?UTF-8?q?handler=E4=B8=AD=E7=9A=84vector=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在列表查询时移除vector字段以减少数据传输量,同时将类型定义中的vector改为可选以匹配实际使用场景 --- src/main/ipc/handlers.ts | 7 ++++++- src/shared/types.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/ipc/handlers.ts b/src/main/ipc/handlers.ts index 825dd52d..8be8d247 100644 --- a/src/main/ipc/handlers.ts +++ b/src/main/ipc/handlers.ts @@ -277,7 +277,12 @@ export function registerHandlers(services: { try { const { keyword, page, pageSize } = payload const res = await unifiedStore.listChunks({ keyword, page, pageSize }) - return res + const normalized = res.items.map((item) => { + const newItem = { ...item } + delete (newItem as any).vector + return newItem + }) + return { items: normalized, total: res.total } } catch (error: any) { console.error('❌ [LIST-CHUNKS] ERROR:', error) return { items: [], total: 0 } diff --git a/src/shared/types.ts b/src/shared/types.ts index 3a587216..ed00f64c 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -41,7 +41,7 @@ export interface ChunkListItem { page: number } createdAt?: number - vector: number[] + vector?: number[] } export interface ChunkListResponse {