diff --git a/im-uniapp/.env.js b/im-uniapp/.env.js new file mode 100644 index 0000000..ade8617 --- /dev/null +++ b/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 \ No newline at end of file diff --git a/im-uniapp/package.json b/im-uniapp/package.json index 6e7405d..c149435 100644 --- a/im-uniapp/package.json +++ b/im-uniapp/package.json @@ -1,6 +1,7 @@ { "uni-app": { "scripts": { + /* "dev-h5": { "title": "开发环境-H5", "browser":"chrome", @@ -35,6 +36,7 @@ "WS_URL": "wss://www.boxim.online:81/im" } } + */ } } } \ No newline at end of file