mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-06 20:42:52 +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:
@@ -233,7 +233,6 @@ const MarkdownViewer: FC<MarkdownViewerProps> = ({ status }) => {
|
||||
<VideoBanner
|
||||
audioMeta={currentTask?.audioMeta}
|
||||
videoUrl={currentTask?.formData?.video_url}
|
||||
baseURL={baseURL}
|
||||
/>
|
||||
</div>
|
||||
<div className={'markdown-body w-full px-2'}>
|
||||
|
||||
@@ -4,7 +4,6 @@ import type { AudioMeta } from '@/store/taskStore'
|
||||
interface VideoBannerProps {
|
||||
audioMeta?: AudioMeta
|
||||
videoUrl?: string
|
||||
baseURL?: string
|
||||
}
|
||||
|
||||
/** 平台 label 映射 */
|
||||
@@ -15,13 +14,14 @@ const platformLabel: Record<string, string> = {
|
||||
xiaohongshu: '小红书',
|
||||
}
|
||||
|
||||
export default function VideoBanner({ audioMeta, videoUrl, baseURL = '' }: VideoBannerProps) {
|
||||
export default function VideoBanner({ audioMeta, videoUrl }: VideoBannerProps) {
|
||||
if (!audioMeta) return null
|
||||
|
||||
const rawCover = audioMeta.cover_url
|
||||
// 通过后端代理加载封面,避免跨域/Referrer 限制
|
||||
const apiBase = String(import.meta.env.VITE_API_BASE_URL || 'api').replace(/\/$/, '')
|
||||
const coverUrl = rawCover
|
||||
? `${baseURL}/image_proxy?url=${encodeURIComponent(rawCover)}`
|
||||
? `${apiBase}/image_proxy?url=${encodeURIComponent(rawCover)}`
|
||||
: ''
|
||||
const title = audioMeta.title
|
||||
const uploader = audioMeta.raw_info?.uploader || ''
|
||||
|
||||
Reference in New Issue
Block a user