mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-07 05:32:52 +08:00
Fixed the problem of abnormal display of front-end page pictures in docker deployment
This commit is contained in:
24
.env.example
24
.env.example
@@ -1,24 +0,0 @@
|
||||
# 通用端口配置
|
||||
BACKEND_PORT=8483 # 后端端口
|
||||
FRONTEND_PORT=3015
|
||||
BACKEND_HOST=0.0.0.0 # 默认为 0.0.0.0,表示监听所有 IP 地址 不建议动
|
||||
APP_PORT= 3015 # docker 部署时用
|
||||
# 前端访问后端用 (开发环境使用)
|
||||
VITE_API_BASE_URL=http://127.0.0.1:8483
|
||||
VITE_SCREENSHOT_BASE_URL=http://127.0.0.1:8483/static/screenshots
|
||||
VITE_FRONTEND_PORT=3015
|
||||
# 生产环境配置
|
||||
ENV=production
|
||||
STATIC=/static
|
||||
OUT_DIR=./static/screenshots
|
||||
NOTE_OUTPUT_DIR=note_results
|
||||
IMAGE_BASE_URL=/static/screenshots
|
||||
DATA_DIR=data
|
||||
# FFMPEG 配置
|
||||
FFMPEG_BIN_PATH=
|
||||
|
||||
# transcriber 相关配置
|
||||
TRANSCRIBER_TYPE=fast-whisper # fast-whisper/bcut/kuaishou/mlx-whisper(仅Apple平台)/groq
|
||||
WHISPER_MODEL_SIZE=base
|
||||
|
||||
GROQ_TRANSCRIBER_MODEL=whisper-large-v3-turbo # groq提供的faster-whisper 默认为 whisper-large-v3-turbo
|
||||
@@ -52,7 +52,8 @@ const MarkdownViewer: FC<MarkdownViewerProps> = ({ status }) => {
|
||||
const [modelName, setModelName] = useState<string>('')
|
||||
const [style, setStyle] = useState<string>('')
|
||||
const [createTime, setCreateTime] = useState<string>('')
|
||||
const baseURL = String(import.meta.env.VITE_API_BASE_URL).replace('/api','') || ''
|
||||
// 确保baseURL没有尾部斜杠
|
||||
const baseURL = (String(import.meta.env.VITE_API_BASE_URL || '').replace('/api','') || '').replace(/\/$/, '')
|
||||
const getCurrentTask = useTaskStore.getState().getCurrentTask
|
||||
const currentTask = useTaskStore(state => state.getCurrentTask())
|
||||
const taskStatus = currentTask?.status || 'PENDING'
|
||||
@@ -307,14 +308,14 @@ const MarkdownViewer: FC<MarkdownViewerProps> = ({ status }) => {
|
||||
|
||||
// Enhanced image with zoom capability
|
||||
img: ({ node, ...props }) =>{
|
||||
|
||||
let src = baseURL +props.src
|
||||
// Fix the URL by removing the 'undefined' prefix if it exists
|
||||
let src = props.src
|
||||
if (src.startsWith('/')) {
|
||||
src = baseURL + src
|
||||
}
|
||||
props.src = src
|
||||
|
||||
|
||||
return(
|
||||
|
||||
|
||||
<div className="my-8 flex justify-center">
|
||||
<Zoom>
|
||||
<img
|
||||
|
||||
@@ -24,7 +24,8 @@ interface NoteHistoryProps {
|
||||
const NoteHistory: FC<NoteHistoryProps> = ({ onSelect, selectedId }) => {
|
||||
const tasks = useTaskStore(state => state.tasks)
|
||||
const removeTask = useTaskStore(state => state.removeTask)
|
||||
const baseURL = import.meta.env.VITE_API_BASE_URL || 'api/'
|
||||
// 确保baseURL没有尾部斜杠
|
||||
const baseURL = (String(import.meta.env.VITE_API_BASE_URL || 'api')).replace(/\/$/, '')
|
||||
const [rawSearch, setRawSearch] = useState('')
|
||||
const [search, setSearch] = useState('')
|
||||
const fuse = new Fuse(tasks, {
|
||||
@@ -101,7 +102,7 @@ const NoteHistory: FC<NoteHistoryProps> = ({ onSelect, selectedId }) => {
|
||||
|
||||
src={
|
||||
task.audioMeta.cover_url
|
||||
? baseURL+`/image_proxy?url=${encodeURIComponent(task.audioMeta.cover_url)}`
|
||||
? `${baseURL}/image_proxy?url=${encodeURIComponent(task.audioMeta.cover_url)}`
|
||||
: '/placeholder.png'
|
||||
}
|
||||
alt="封面"
|
||||
|
||||
Reference in New Issue
Block a user