Browse Source

feat:兼容安卓和ios

master
xsx 2 years ago
parent
commit
3f2aef8c4a
  1. 23
      im-uniapp/.env.js
  2. 2
      im-uniapp/package.json

23
im-uniapp/.env.js

@ -0,0 +1,23 @@
//设置环境(打包前修改此变量)
const ENV = "PROD";
const UNI_APP = {
}
if(ENV=="DEV"){
// 开发环境
UNI_APP.BASE_URL = "http://192.168.2.67:8888";
UNI_APP.WS_URL = "ws://192.168.2.67:8878/im";
// H5 走本地代理避免跨域问题
// #ifdef H5
UNI_APP.BASE_URL = "/api";
// #endif
}
if(ENV=="PROD"){
// 生产环境
UNI_APP.BASE_URL = "https://www.boxim.online/api";
UNI_APP.WS_URL = "wss://www.boxim.online:81/im";
}
export default UNI_APP

2
im-uniapp/package.json

@ -1,6 +1,7 @@
{ {
"uni-app": { "uni-app": {
"scripts": { "scripts": {
/*
"dev-h5": { "dev-h5": {
"title": "开发环境-H5", "title": "开发环境-H5",
"browser":"chrome", "browser":"chrome",
@ -35,6 +36,7 @@
"WS_URL": "wss://www.boxim.online:81/im" "WS_URL": "wss://www.boxim.online:81/im"
} }
} }
*/
} }
} }
} }
Loading…
Cancel
Save