fix: 修复Docker构建和路径解析问题
- 在Dockerfile中使用npm中国镜像加速依赖安装 - 修正后端健康检查端点路径 - 修复Docker环境中图片路径解析问题 - 修正前端API地址默认值
This commit is contained in:
@@ -8,8 +8,9 @@ WORKDIR /app
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm ci
|
||||
# Install dependencies with Chinese mirror
|
||||
RUN npm config set registry https://registry.npmmirror.com && \
|
||||
npm ci
|
||||
|
||||
# ========================================
|
||||
# Stage 2: Builder
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Settings, Save, CheckCircle, XCircle, Eye, EyeOff, Server, Globe, Datab
|
||||
|
||||
// 从环境变量或 localStorage 获取 API 地址
|
||||
const getDefaultApiUrl = () => {
|
||||
return import.meta.env.VITE_API_URL || localStorage.getItem('api_base_url') || '/';
|
||||
return import.meta.env.VITE_API_URL || localStorage.getItem('api_base_url') || '';
|
||||
};
|
||||
|
||||
type ApiConfig = {
|
||||
|
||||
Reference in New Issue
Block a user