Files
template-10584/config/env.ts
赵忠林 b9c03be394 feat(withdraw): 实现微信商家转账收款确认功能
- 配置文件中更新测试环境API基础URL
- 添加ShopDealerWithdrawCreateResult类型定义以支持微信转账返回的package_info
- 修改addShopDealerWithdraw函数以处理微信转账流程的特殊返回值
- 实现extractPackageInfo、canRequestMerchantTransferConfirm和requestMerchantTransferConfirm辅助函数
- 在微信钱包提现流程中集成商户转账确认页面调用
- 添加对微信小程序环境的检测和错误处理
- 更新快速金额选项,增加1元选项
- 修改微信提现提示文字,说明需要确认收款的流程
2026-01-31 18:57:32 +08:00

44 lines
933 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: '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()