From 01a1c55de8d78c2ca9094f4a4b4c32d9bbd41f5f Mon Sep 17 00:00:00 2001 From: xiaopeng <1509442308@qq.com> Date: Tue, 2 Jun 2026 09:57:26 +0800 Subject: [PATCH] fix: resolve image 404 and add favicon Markdown image src with relative paths (/images/...) now resolves to backend API URL instead of frontend port. Added SVG favicon to eliminate 404 on /favicon.ico. Co-Authored-By: Claude Opus 4.7 --- .gitignore | 2 ++ web/src/app/icon.svg | 4 ++++ web/src/components/chat/message-item.tsx | 12 ++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 web/src/app/icon.svg diff --git a/.gitignore b/.gitignore index 2947302..5a6c0e5 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,5 @@ Desktop.ini *.coverage .coverage htmlcov/ + +officefile diff --git a/web/src/app/icon.svg b/web/src/app/icon.svg new file mode 100644 index 0000000..d8d2c95 --- /dev/null +++ b/web/src/app/icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/web/src/components/chat/message-item.tsx b/web/src/components/chat/message-item.tsx index 41ecec0..3518310 100644 --- a/web/src/components/chat/message-item.tsx +++ b/web/src/components/chat/message-item.tsx @@ -252,10 +252,14 @@ export default function MessageItem({ message, selectedModel }: MessageItemProps td: ({ children }) => ( {children} ), - img: ({ src, alt }: any) => ( - + img: ({ src, alt }: any) => { + const resolvedSrc = src && src.startsWith("/") + ? `${process.env.NEXT_PUBLIC_API_URL || `${window.location.protocol}//${window.location.hostname}:8000`}${src}` + : src; + return ( +