修复开发环境图片显示bug

This commit is contained in:
dzl
2025-09-02 17:21:49 +08:00
parent 8d50c6dadf
commit 944998ce59

View File

@@ -1,7 +1,7 @@
// 环境配置 // 环境配置
const config = { const config = {
development: { development: {
baseURL: 'http://localhost:3000', baseURL: 'https://minio.zrbjr.com/',
uploadURL: import.meta.env.VITE_UPLOAD_BASE_URL || 'http://localhost:3000/api/upload' uploadURL: import.meta.env.VITE_UPLOAD_BASE_URL || 'http://localhost:3000/api/upload'
}, },
production: { production: {
@@ -36,7 +36,7 @@ export const getImageUrl = (imagePath) => {
const cleanBaseURL = baseURL.replace(/\/$/, '') const cleanBaseURL = baseURL.replace(/\/$/, '')
const cleanImagePath = imagePath.startsWith('/') ? imagePath : `/${imagePath}` const cleanImagePath = imagePath.startsWith('/') ? imagePath : `/${imagePath}`
const fullUrl = `${cleanBaseURL}${cleanImagePath}` const fullUrl = `${cleanBaseURL}${cleanImagePath}`
console.log('Development environment, returning:', fullUrl) // console.log('Development environment, returning:', fullUrl)
return fullUrl return fullUrl
} }