更新请求环境配置
This commit is contained in:
33
config/index.js
Normal file
33
config/index.js
Normal file
@ -0,0 +1,33 @@
|
||||
// 全局配置文件
|
||||
const config = {
|
||||
// 开发环境
|
||||
development: {
|
||||
BASE_URL: 'http://192.168.2.34:8000',
|
||||
API_PREFIX: '',
|
||||
// MQTT 配置
|
||||
MQTT_HOST: '47.120.79.150',
|
||||
MQTT_PORT: 8083,
|
||||
MQTT_USERNAME: 'admin',
|
||||
MQTT_PASSWORD: '#YtvpSfCNG'
|
||||
},
|
||||
// 生产环境
|
||||
production: {
|
||||
BASE_URL: 'https://fuyuanshen.com/backend',
|
||||
API_PREFIX: '',
|
||||
// MQTT 配置
|
||||
MQTT_HOST: '47.120.79.150',
|
||||
MQTT_PORT: 8083,
|
||||
MQTT_USERNAME: 'admin',
|
||||
MQTT_PASSWORD: '#YtvpSfCNG'
|
||||
}
|
||||
}
|
||||
|
||||
// 根据环境获取配置
|
||||
function getConfig() {
|
||||
// 这里可以根据实际情况判断环境
|
||||
// 开发阶段使用development,上线后改为production
|
||||
const env = 'development' // 或者 'production'
|
||||
return config[env]
|
||||
}
|
||||
|
||||
export default getConfig()
|
Reference in New Issue
Block a user