From 9f6939ecc79ba5379a50223ffd08c52425c08103 Mon Sep 17 00:00:00 2001 From: Momentry Studio Date: Sat, 10 Oct 2026 22:54:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20get=5Ffiles=20HTTP?= =?UTF-8?q?=20=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0=E5=90=8D=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题: - 前端在浏览器模式下使用 `limit` 参数 - Core API 的实际参数名是 `page_size` - 导致 Core API 忽略参数,使用默认值 20 - 用户只看到 20 个文件(Completed 18 + Registered 1 + Unregistered 1) - 实际 API 返回 118 个文件 修复: - 将 `limit=` 改为 `page_size=` - 与 Core API 参数名保持一致 - 确保前端获取所有文件 影响: - Library 页面现在显示所有 118 个文件 - Completed 64 张卡片 - Registered 53 张卡片 - Unregistered 1 张卡片 测试: ✅ 编译通过 ✅ API 正确返回 118 个文件 ✅ 参数正确传递 --- src/api/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/index.ts b/src/api/index.ts index a0502a0..65629b5 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -245,7 +245,7 @@ function buildHttpRequest(cmd: string, args: Record): { url: string // --- Data APIs --- case 'get_files': { const ps = a.args?.pageSize || 500 - return { url: `/api/v1/files?limit=${ps}`, method: 'GET' } + return { url: `/api/v1/files?page_size=${ps}`, method: 'GET' } } case 'get_people': { return { url: `/api/v1/identities?page=${a.page || 1}&per_page=${a.perPage || 100}`, method: 'GET' }