- 将开发环境、生产环境和测试环境的API_BASE_URL统一更新为新的域名websopy-api.websoft.top - 更新SimpleQRCodeModal组件中二维码请求地址,使用新的API域名 - 在邀请信息请求函数fetchInviteInfo中添加详细的请求和响应日志 - 增加接口错误日志打印,提高捕获异常时的信息丰富度
44 lines
951 B
TypeScript
44 lines
951 B
TypeScript
// 环境变量配置
|
|
export const ENV_CONFIG = {
|
|
// 开发环境
|
|
development: {
|
|
// API_BASE_URL: 'http://127.0.0.1:9200/api',
|
|
API_BASE_URL: 'https://websopy-api.websoft.top/api',
|
|
APP_NAME: '开发环境',
|
|
DEBUG: 'true',
|
|
},
|
|
// 生产环境
|
|
production: {
|
|
API_BASE_URL: 'https://websopy-api.websoft.top/api',
|
|
APP_NAME: '网宿软件',
|
|
DEBUG: 'false',
|
|
},
|
|
// 测试环境
|
|
test: {
|
|
API_BASE_URL: 'https://websopy-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()
|