fix: 修复 get_files 调用错误的 API 端点

问题:
- 前端调用 /api/v1/files/scan
- 该 API 扫描文件系统,依赖 MOMENTRY_SFTP_ROOT 环境变量
- 如果未设置或目录不存在,返回空数组
- 导致显示 'No files found'

修复:
- 改为调用 /api/v1/files
- 该 API 直接从数据库读取已注册文件
- 返回 { success: true, total: 176, data: [...] }

测试:
- ✅ /api/v1/files 返回 176 个文件
- ✅ 前端应该能正确显示文件列表
This commit is contained in:
2026-10-09 22:35:24 +08:00
parent 589712e868
commit c90d93c224

View File

@@ -245,7 +245,7 @@ function buildHttpRequest(cmd: string, args: Record<string, any>): { url: string
// --- Data APIs ---
case 'get_files': {
const ps = a.args?.pageSize || 500
return { url: `/api/v1/files/scan?page_size=${ps}`, method: 'GET' }
return { url: `/api/v1/files?limit=${ps}`, method: 'GET' }
}
case 'get_people': {
return { url: `/api/v1/identities?page=${a.page || 1}&per_page=${a.perPage || 100}`, method: 'GET' }