Files
template-10584/config/env.ts
赵忠林 f73bfeb743 refactor(礼品卡): 优化礼品卡相关功能和界面
- 修改 API 基础 URL以适应开发环境
- 移除未使用的 StoreCell 组件- 在 ShopGift 模型中添加核销时间字段
-调整 GiftCard 组件样式和布局
- 更新 goodsDetail 页面中的规格选择逻辑
- 优化 gift 组件中的有效期和类型显示
- 在 redeemGift 中添加礼品卡核销时间
- 重构 storeVerification 组件逻辑,优化核销流程
2025-08-17 20:16:29 +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()