From 3f2aef8c4a3368763d31eaba0809ad94118e0eb0 Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Sat, 24 Feb 2024 21:01:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=85=BC=E5=AE=B9=E5=AE=89=E5=8D=93?= =?UTF-8?q?=E5=92=8Cios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im-uniapp/.env.js | 23 +++++++++++++++++++++++ im-uniapp/package.json | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 im-uniapp/.env.js 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