Files
template-10584/config/env.ts
赵忠林 afe8f93c32 fix(config): 恢复开发和测试环境API配置
- 将开发环境API_BASE_URL从线上地址改回本地地址
- 在开发环境注释掉线上API地址配置
- 将测试环境API_BASE_URL从线上地址改回本地地址
- 在测试环境注释掉线上API地址配置

fix(order): 修复待收货状态下订单操作权限控制

- 在待收货状态判断条件中增加orderStatus !== 6的限制
- 防止已完成订单在待收货状态下显示查看物流和确认收货按钮
2026-02-04 15:10:31 +08:00

45 lines
983 B
TypeScript

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