Files
Message-Push-Nest/web/config.js
T
zimonianhua 3519a26495
Docker Build and Push / build (push) Has been cancelled
chore: 删除已弃用的部署工作流并更新生产环境检测
删除三个已弃用的 GitHub Actions 工作流文件 (deploy_docs_pages.yml, demo_site_deploy.yml, custom_deploy.yml),这些工作流已不再使用。
同时更新 web/config.js 中的生产环境检测逻辑,使其同时识别 'prod' 和 'production' 环境变量值,提高配置的灵活性。
2026-02-10 20:17:26 +08:00

17 lines
404 B
JavaScript

// config.js
const isProduction = process.env.NODE_ENV === 'prod' || process.env.NODE_ENV === 'production';
// 从 window 对象获取路径前缀(由后端注入或通过 API 获取)
const getPathPrefix = () => {
return window.__URL_PATH_PREFIX__ || '';
};
const config = {
apiUrl: isProduction ? '' : 'http://localhost:8000',
pathPrefix: getPathPrefix(),
};
export default config;