mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-08-28 03:26:44 +08:00
fix(ui): 修复 Banner 封面图不显示
MarkdownViewer 的 baseURL 去掉了 /api 前缀,导致 image_proxy 请求路径错误。改为组件内部直接读取 VITE_API_BASE_URL,与 NoteHistory 保持一致。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
c46c971e64
commit
795615f0f7
@@ -233,7 +233,6 @@ const MarkdownViewer: FC<MarkdownViewerProps> = ({ status }) => {
|
|||||||
<VideoBanner
|
<VideoBanner
|
||||||
audioMeta={currentTask?.audioMeta}
|
audioMeta={currentTask?.audioMeta}
|
||||||
videoUrl={currentTask?.formData?.video_url}
|
videoUrl={currentTask?.formData?.video_url}
|
||||||
baseURL={baseURL}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className={'markdown-body w-full px-2'}>
|
<div className={'markdown-body w-full px-2'}>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import type { AudioMeta } from '@/store/taskStore'
|
|||||||
interface VideoBannerProps {
|
interface VideoBannerProps {
|
||||||
audioMeta?: AudioMeta
|
audioMeta?: AudioMeta
|
||||||
videoUrl?: string
|
videoUrl?: string
|
||||||
baseURL?: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 平台 label 映射 */
|
/** 平台 label 映射 */
|
||||||
@@ -15,13 +14,14 @@ const platformLabel: Record<string, string> = {
|
|||||||
xiaohongshu: '小红书',
|
xiaohongshu: '小红书',
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function VideoBanner({ audioMeta, videoUrl, baseURL = '' }: VideoBannerProps) {
|
export default function VideoBanner({ audioMeta, videoUrl }: VideoBannerProps) {
|
||||||
if (!audioMeta) return null
|
if (!audioMeta) return null
|
||||||
|
|
||||||
const rawCover = audioMeta.cover_url
|
const rawCover = audioMeta.cover_url
|
||||||
// 通过后端代理加载封面,避免跨域/Referrer 限制
|
// 通过后端代理加载封面,避免跨域/Referrer 限制
|
||||||
|
const apiBase = String(import.meta.env.VITE_API_BASE_URL || 'api').replace(/\/$/, '')
|
||||||
const coverUrl = rawCover
|
const coverUrl = rawCover
|
||||||
? `${baseURL}/image_proxy?url=${encodeURIComponent(rawCover)}`
|
? `${apiBase}/image_proxy?url=${encodeURIComponent(rawCover)}`
|
||||||
: ''
|
: ''
|
||||||
const title = audioMeta.title
|
const title = audioMeta.title
|
||||||
const uploader = audioMeta.raw_info?.uploader || ''
|
const uploader = audioMeta.raw_info?.uploader || ''
|
||||||
|
|||||||
Reference in New Issue
Block a user