3 changed files with 13 additions and 48 deletions
@ -1,23 +1,16 @@ |
|||||
//设置环境(打包前修改此变量)
|
//设置环境(打包前修改此变量)
|
||||
const ENV = "PROD"; |
const ENV = "DEV"; |
||||
|
const UNI_APP = {} |
||||
const UNI_APP = { |
|
||||
} |
|
||||
|
|
||||
if(ENV=="DEV"){ |
if(ENV=="DEV"){ |
||||
// 开发环境
|
UNI_APP.BASE_URL = "http://127.0.0.1:8888"; |
||||
UNI_APP.BASE_URL = "http://192.168.2.67:8888"; |
UNI_APP.WS_URL = "ws://127.0.0.1:8878/im"; |
||||
UNI_APP.WS_URL = "ws://192.168.2.67:8878/im"; |
// H5 走本地代理解决跨域问题
|
||||
// H5 走本地代理避免跨域问题
|
|
||||
// #ifdef H5
|
// #ifdef H5
|
||||
UNI_APP.BASE_URL = "/api"; |
UNI_APP.BASE_URL = "/api"; |
||||
// #endif
|
// #endif
|
||||
} |
} |
||||
|
|
||||
if(ENV=="PROD"){ |
if(ENV=="PROD"){ |
||||
// 生产环境
|
|
||||
UNI_APP.BASE_URL = "https://www.boxim.online/api"; |
UNI_APP.BASE_URL = "https://www.boxim.online/api"; |
||||
UNI_APP.WS_URL = "wss://www.boxim.online:81/im"; |
UNI_APP.WS_URL = "wss://www.boxim.online:81/im"; |
||||
} |
} |
||||
|
|
||||
export default UNI_APP |
export default UNI_APP |
||||
@ -1,42 +1,6 @@ |
|||||
{ |
{ |
||||
"uni-app": { |
"uni-app": { |
||||
"scripts": { |
"scripts": { |
||||
/* |
|
||||
"dev-h5": { |
|
||||
"title": "开发环境-H5", |
|
||||
"browser":"chrome", |
|
||||
"env": { |
|
||||
"UNI_PLATFORM": "h5", |
|
||||
"BASE_URL": "/api", |
|
||||
"WS_URL": "ws://127.0.0.1:8878/im" |
|
||||
} |
|
||||
}, |
|
||||
"dev-wx-mini": { |
|
||||
"title": "开发环境-微信小程序", |
|
||||
"env": { |
|
||||
"UNI_PLATFORM": "mp-weixin", |
|
||||
"BASE_URL": "http://127.0.0.1:8888", |
|
||||
"WS_URL": "ws://127.0.0.1:8878/im" |
|
||||
} |
|
||||
}, |
|
||||
"prod-h5": { |
|
||||
"title": "正式环境-H5", |
|
||||
"browser":"chrome", |
|
||||
"env": { |
|
||||
"UNI_PLATFORM": "h5", |
|
||||
"BASE_URL": "https://www.boxim.online/api", |
|
||||
"WS_URL": "wss://www.boxim.online:81/im" |
|
||||
} |
|
||||
}, |
|
||||
"prod-wx-mini": { |
|
||||
"title": "正式环境-微信小程序", |
|
||||
"env": { |
|
||||
"UNI_PLATFORM": "mp-weixin", |
|
||||
"BASE_URL": "https://www.boxim.online/api", |
|
||||
"WS_URL": "wss://www.boxim.online:81/im" |
|
||||
} |
|
||||
} |
|
||||
*/ |
|
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
Loading…
Reference in new issue