From c00dcfbfbb18ab373e9f7a9056715d4155c2ef5e Mon Sep 17 00:00:00 2001 From: Momentry Studio Date: Sat, 31 Oct 2026 00:52:16 +0800 Subject: [PATCH] fix: add missing proxy routes and API keys for Core API endpoints - Added proxy routes for /api/v1/file/*/json/face_cluster, /api/v1/file/*/traces, /api/v1/admin/config, /api/v1/file-profile - Added requiresApiKey: true to get_cluster_results - Fixes 500 errors when loading cluster results and other Core API endpoints --- src/api/index.ts | 2 +- vite.config.ts | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/api/index.ts b/src/api/index.ts index 667f4c1..ba108b2 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -570,7 +570,7 @@ case 'search_keyword': { return { url: `/api/v1/file/${a.fileUuid}/cluster-agent`, method: 'POST', body: { confirm: true }, timeout: 600000 } } case 'get_cluster_results': { - return { url: `/api/v1/file/${a.fileHash}/json/face_cluster`, method: 'POST', body: {} } + return { url: `/api/v1/file/${a.fileHash}/json/face_cluster`, method: 'POST', body: {}, requiresApiKey: true } } case 'get_similar_face_groups': { const params = new URLSearchParams() diff --git a/vite.config.ts b/vite.config.ts index d8f4427..ecf7633 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -28,6 +28,38 @@ export default defineConfig({ '.ddns.net' ], proxy: { + '/api/v1/trace-profile-file': { + target: 'http://localhost:3002', + changeOrigin: true, + }, + '/api/v1/trace-profile': { + target: 'http://localhost:3002', + changeOrigin: true, + }, + '/api/v1/cluster-results': { + target: 'http://localhost:3002', + changeOrigin: true, + }, + '/api/v1/file/*/thumbnail': { + target: 'http://localhost:3002', + changeOrigin: true, + }, + '/api/v1/file/*/json/face_cluster': { + target: 'http://localhost:3002', + changeOrigin: true, + }, + '/api/v1/file/*/traces': { + target: 'http://localhost:3002', + changeOrigin: true, + }, + '/api/v1/admin/config': { + target: 'http://localhost:3002', + changeOrigin: true, + }, + '/api/v1/file-profile': { + target: 'http://localhost:3002', + changeOrigin: true, + }, '/api/v1': { target: 'http://localhost:8888', changeOrigin: true,