Files
xinlong-shop-taro/config/env.js
赵忠林 f1c0349f64 feat(api): 新增 cms-api API 域名支持并切换幻灯片广告接口域名
- 配置文件 env.js 中新增 CMS_API_URL,三个环境均统一配置
- app.ts 导出 CmsBaseUrl,用于 cms-api 相关请求
- cmsAd 模块接口调用统一改为通过 CmsBaseUrl 拼接完整 cms-api 路径
- 幻灯片广告相关接口走独立 cms-api 域名,保证数据隔离
- 更新工作备忘录,补充 API 域名配置与幻灯片广告调用说明
2026-07-27 12:42:27 +08:00

32 lines
995 B
JavaScript

const CURRENT_ENV = process.env.NODE_ENV === 'production' ? 'production' : 'development'
export const ENV_CONFIG = {
development: {
API_BASE_URL: 'https://shop-api.websoft.top/api',
SERVER_API_URL: 'https://server.websoft.top/api',
CMS_API_URL: 'https://cms-api.websoft.top/api',
APP_NAME: '鑫龙家电',
DEBUG: 'true',
},
test: {
API_BASE_URL: 'https://shop-api.websoft.top/api',
SERVER_API_URL: 'https://server.websoft.top/api',
CMS_API_URL: 'https://cms-api.websoft.top/api',
APP_NAME: '鑫龙家电',
DEBUG: 'true',
},
production: {
API_BASE_URL: 'https://shop-api.websoft.top/api',
SERVER_API_URL: 'https://server.websoft.top/api',
CMS_API_URL: 'https://cms-api.websoft.top/api',
APP_NAME: '鑫龙家电',
DEBUG: 'false',
},
}
export function getEnvConfig() {
return ENV_CONFIG[CURRENT_ENV] || ENV_CONFIG.development
}
export const { API_BASE_URL, SERVER_API_URL, CMS_API_URL, APP_NAME, DEBUG } = getEnvConfig()