Files
glt-taro/config/env.ts
赵忠林 6b1e506f43 feat(order): 增加订单确认页面数量步长控制功能
- 在订单确认页面实现商品购买数量的步长控制机制
- 添加了商品模型中的step字段支持,用于定义购买步长
- 实现了水票套票模板的step配置和最小购买数量逻辑
- 优化了订单参数解析逻辑,支持orderData模式下的商品规格信息传递
- 更新了API基础URL配置,切换到新的测试服务器地址
- 在下单接口中增加了skuId和specInfo参数传递支持
- 完善了数量变更时的价格计算和库存限制逻辑
2026-03-16 00:19:30 +08:00

45 lines
989 B
TypeScript

// 环境变量配置
export const ENV_CONFIG = {
// 开发环境
development: {
API_BASE_URL: 'http://127.0.0.1:9200/api',
// API_BASE_URL: 'https://glt-api2.websoft.top/api',
APP_NAME: '开发环境',
DEBUG: 'true',
},
// 生产环境
production: {
API_BASE_URL: 'https://glt-api2.websoft.top/api',
APP_NAME: '桂乐淘',
DEBUG: 'false',
},
// 测试环境
test: {
// API_BASE_URL: 'http://127.0.0.1:9200/api',
API_BASE_URL: 'https://glt-api2.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()