youdas/common/env.js
2025-06-20 16:06:03 +08:00

40 lines
1.0 KiB
JavaScript

/**
* 项目环境配置文件
* 集中管理所有环境相关的配置参数
*/
// 开发环境配置
const development = {
// API基础URL
baseUrl: 'https://testapi.zfunbox.cn',
// 图片资源URL
imageUrl: 'https://image.zfunbox.cn',
routeMapSecretKey: 'g6R@9!zB2fL#1cVm',
normalizeResponseKeys: 'g6R@9!zB2fL#1cVm'
};
// 生产环境配置
const production = {
baseUrl: 'https://api.zfunbox.cn',
imageUrl: 'https://image.zfunbox.cn',
routeMapSecretKey: 'g6R@9!zB2fL#1cVm',
normalizeResponseKeys: 'g6R@9!zB2fL#1cVm'
};
// 测试环境配置
const testing = {
baseUrl: 'https://testapi.zfunbox.cn',
imageUrl: 'https://image.zfunbox.cn',
routeMapSecretKey: 'g6R@9!zB2fL#1cVm',
normalizeResponseKeys: 'g6R@9!zB2fL#1cVm'
};
// 根据环境变量选择对应配置
let currentEnv = testing;//production;//testing;
// 衍生配置
const config = {
...currentEnv,
// API请求完整路径
apiBaseUrl: currentEnv.baseUrl + '/api/',
};
export default config;