Docker Build and Push / build (push) Has been cancelled
- 删除Dockerfile中不必要的mailcap包以精简镜像 - 将前端配置从process.env改为import.meta.env以适配现代构建工具 - 移除Go代码中手动设置mime类型的冗余逻辑 - 修复静态资源路由路径格式(/assets改为assets/) - 优化导入语句格式和代码结构
17 lines
352 B
JavaScript
17 lines
352 B
JavaScript
// config.js
|
|
|
|
const isProduction = import.meta.env.PROD;
|
|
|
|
// 从 window 对象获取路径前缀(由后端注入或通过 API 获取)
|
|
const getPathPrefix = () => {
|
|
return window.__URL_PATH_PREFIX__ || '';
|
|
};
|
|
|
|
const config = {
|
|
apiUrl: isProduction ? '' : 'http://localhost:8000',
|
|
pathPrefix: getPathPrefix(),
|
|
};
|
|
|
|
export default config;
|
|
|