65 lines
1.6 KiB
JavaScript
65 lines
1.6 KiB
JavaScript
/**
|
||
* 小程序配置文件
|
||
* 包含API地址、环境配置等
|
||
*/
|
||
|
||
// 环境配置
|
||
const ENV = {
|
||
// 开发环境
|
||
development: {
|
||
API_BASE_URL: 'http://localhost:3000/api',
|
||
WS_URL: 'ws://localhost:3000',
|
||
DEBUG: true,
|
||
TEST_MODE: true // 测试模式:充值不走真实支付
|
||
},
|
||
// 测试环境
|
||
staging: {
|
||
API_BASE_URL: 'https://test-api.maimanji.com/api',
|
||
WS_URL: 'wss://test-api.maimanji.com',
|
||
DEBUG: true,
|
||
TEST_MODE: true // 测试模式:充值不走真实支付
|
||
},
|
||
// 生产环境
|
||
production: {
|
||
API_BASE_URL: 'https://ai-c.maimanji.com/api',
|
||
WS_URL: 'wss://ai-c.maimanji.com',
|
||
DEBUG: false,
|
||
TEST_MODE: false, // 关闭测试模式,使用真实微信支付(后端测试支付接口有数据库错误)
|
||
PAYMENT_CHANNEL: 'huifu' // 支付渠道:huifu=汇付天下, wechat=官方微信支付
|
||
}
|
||
}
|
||
|
||
// 当前环境 - 可根据需要切换
|
||
// development: 本地开发 staging: 测试环境 production: 正式环境
|
||
const CURRENT_ENV = 'production'
|
||
|
||
// 硬编码版本号 - 用于审核开关对比
|
||
const APP_VERSION = '2.0'
|
||
|
||
// 导出配置
|
||
const config = {
|
||
...ENV[CURRENT_ENV],
|
||
ENV: CURRENT_ENV,
|
||
APP_VERSION: APP_VERSION,
|
||
|
||
// 存储键名
|
||
STORAGE_KEYS: {
|
||
TOKEN: 'auth_token',
|
||
REFRESH_TOKEN: 'refresh_token',
|
||
USER_INFO: 'user_info',
|
||
USER_ID: 'user_id',
|
||
TOKEN_EXPIRY: 'token_expiry' // Token过期时间
|
||
},
|
||
|
||
// 请求超时时间(毫秒)
|
||
REQUEST_TIMEOUT: 30000,
|
||
|
||
// 分页默认配置
|
||
PAGE_SIZE: 20,
|
||
|
||
// 版本号
|
||
VERSION: '1.0.0'
|
||
}
|
||
|
||
module.exports = config
|