Files
mp-10550/config/env.ts
赵忠林 1f6ecebc6a feat(user): 优化礼品卡核销功能
- 修改 API基础 URL 为正式环境地址
- 移除礼品卡信息中的 useTime 字段
-优化礼品卡核销页面布局和功能
- 完善礼品卡信息展示,包括商品图片、描述等
- 优化手动输入核销码流程,支持直接验证- 调整礼品卡状态展示方式,增加过期状态- 优化代码结构,提高可读性和可维护性
2025-08-18 02:10:42 +08:00

43 lines
900 B
TypeScript

// 环境变量配置
export const ENV_CONFIG = {
// 开发环境
development: {
API_BASE_URL: 'https://cms-api.websoft.top/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()