diff --git a/frontend/src/components/ListSpaceSidebar.vue b/frontend/src/components/ListSpaceSidebar.vue index 964d13ee..3eef94c8 100644 --- a/frontend/src/components/ListSpaceSidebar.vue +++ b/frontend/src/components/ListSpaceSidebar.vue @@ -289,9 +289,9 @@ onBeforeUnmount(() => { .resize-handle { position: absolute; top: 0; - right: -4px; + right: -6px; bottom: 0; - width: 8px; + width: 12px; cursor: col-resize; z-index: 12; display: flex; @@ -307,10 +307,10 @@ onBeforeUnmount(() => { .resize-handle-line { width: 2px; - height: 32px; + height: 40px; border-radius: 1px; background: #c5cad1; - opacity: 0; + opacity: 0.45; transition: opacity 0.2s ease, background 0.2s ease; } diff --git a/frontend/src/components/doc-content.vue b/frontend/src/components/doc-content.vue index c5a1944f..b8e040a4 100644 --- a/frontend/src/components/doc-content.vue +++ b/frontend/src/components/doc-content.vue @@ -7,7 +7,7 @@ import mermaid from "mermaid"; import { onMounted, ref, nextTick, onUnmounted, onUpdated, watch } from "vue"; import { downKnowledgeDetails, deleteGeneratedQuestion } from "@/api/knowledge-base/index"; import { MessagePlugin, DialogPlugin } from "tdesign-vue-next"; -import { sanitizeHTML, safeMarkdownToHTML, createSafeImage, isValidImageURL } from '@/utils/security'; +import { sanitizeHTML, safeMarkdownToHTML, createSafeImage, isValidImageURL, hydrateProtectedFileImages } from '@/utils/security'; import { openMermaidFullscreen } from '@/utils/mermaidViewer'; import { useI18n } from 'vue-i18n'; import DocumentPreview from '@/components/document-preview.vue'; @@ -269,7 +269,9 @@ const isMarkdownFile = (fileType?: string): boolean => { }; watch(() => props.details.md, (newVal) => { nextTick(async () => { - const images = mdContentWrap.value.querySelectorAll('img.markdown-image'); + const renderRoot = (doc as ParentNode) || mdContentWrap.value; + await hydrateProtectedFileImages(renderRoot); + const images = renderRoot?.querySelectorAll?.('img.markdown-image') as NodeListOf | undefined; if (images) { images.forEach(async item => { const isValid = await checkImage(item.src); diff --git a/frontend/src/utils/security.ts b/frontend/src/utils/security.ts index ef6dd815..a446539b 100644 --- a/frontend/src/utils/security.ts +++ b/frontend/src/utils/security.ts @@ -123,7 +123,8 @@ function protectProviderImageSrcInHTML(html: string): string { (_m, before, quote, provider, restPathRaw, after) => { const restPath = decodeProviderURL(restPathRaw); const protectedSrc = `${provider}://${restPath}`; - return ``; + const fileProxyURL = `/files?${new URLSearchParams({ file_path: protectedSrc }).toString()}`; + return ``; }, ); }