Files
mp-10550/config/env.ts
赵忠林 1c2e00b7ba feat(shop): 添加文章详情页面并优化购物车样式
- 新增文章详情页面组件,用于显示文章内容
- 优化购物车页面样式,增加空购物车状态的透明背景
- 添加多个购物相关 API 接口,包括优惠券、订单等
- 更新环境配置,修改 API 基础 URL
- 调整发现页面布局,增加文章详情入口
2025-08-13 01:37:07 +08:00

43 lines
894 B
TypeScript

// 环境变量配置
export const ENV_CONFIG = {
// 开发环境
development: {
API_BASE_URL: 'http://127.0.0.1:9200/api',
APP_NAME: '开发环境',
DEBUG: 'true',
},
// 生产环境
production: {
API_BASE_URL: 'https://cms-api.websoft.top/api',
APP_NAME: '时里院子市集',
DEBUG: 'false',
},
// 测试环境
test: {
API_BASE_URL: 'https://cms-api.s209.websoft.top/api',
APP_NAME: '测试环境',
DEBUG: 'true',
}
}
// 获取当前环境配置
export function getEnvConfig() {
const env = process.env.NODE_ENV || 'development'
if (env === 'production') {
return ENV_CONFIG.production
} else { // @ts-ignore
if (env === 'test') {
return ENV_CONFIG.test
} else {
return ENV_CONFIG.development
}
}
}
// 导出环境变量
export const {
API_BASE_URL,
APP_NAME,
DEBUG
} = getEnvConfig()