From 0bedd7ff6fe6b9261eff2c6f431f58d2564c9947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BB=BA=E6=AD=A6?= Date: Tue, 6 May 2025 13:13:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E7=94=9F=E6=88=90=E9=80=BB=E8=BE=91-=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E7=94=9F=E6=88=90=E6=88=AA=E5=9B=BE?= =?UTF-8?q?=20URL=20=E7=9A=84=E6=96=B9=E5=BC=8F=EF=BC=8C=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84=E6=9B=BF=E4=BB=A3=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84-=20=E5=9C=A8=E5=89=8D=E7=AB=AF=20Vi?= =?UTF-8?q?te=20=E9=85=8D=E7=BD=AE=E4=B8=AD=E6=B7=BB=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E5=AF=B9=20/static=E8=B7=AF=E5=BE=84=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BillNote_frontend/vite.config.ts | 5 +++++ backend/app/services/note.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/BillNote_frontend/vite.config.ts b/BillNote_frontend/vite.config.ts index cd017d1..5c9937d 100644 --- a/BillNote_frontend/vite.config.ts +++ b/BillNote_frontend/vite.config.ts @@ -25,6 +25,11 @@ export default defineConfig(({ mode }) => { changeOrigin: true, rewrite: path => path.replace(/^\/api/, '/api'), }, + '/static': { + target: apiBaseUrl, + changeOrigin: true, + rewrite: path => path.replace(/^\/static/, '/static'), + }, }, }, } diff --git a/backend/app/services/note.py b/backend/app/services/note.py index d5456e6..bc8f13b 100644 --- a/backend/app/services/note.py +++ b/backend/app/services/note.py @@ -136,7 +136,7 @@ class NoteGenerator: for idx, (marker, ts) in enumerate(matches): image_path = generate_screenshot(video_path, output_dir, ts, idx) image_relative_path = os.path.join(image_base_url, os.path.basename(image_path)).replace("\\", "/") - image_url = f"{BACKEND_BASE_URL.rstrip('/')}/{image_relative_path.lstrip('/')}" + image_url = f"/static/screenshots/{os.path.basename(image_path)}" replacement = f"![]({image_url})" new_markdown = new_markdown.replace(marker, replacement, 1)