diff --git a/env/cl.js b/env/cl.js new file mode 100644 index 0000000..31228e3 --- /dev/null +++ b/env/cl.js @@ -0,0 +1,5 @@ +const ENV_PATH = { + baseUrl: 'http://192.168.31.161:9999', // 长龙 +} + +module.exports = ENV_PATH \ No newline at end of file diff --git a/env/dev.js b/env/dev.js new file mode 100644 index 0000000..89fc05f --- /dev/null +++ b/env/dev.js @@ -0,0 +1,5 @@ +const ENV_PATH = { + baseUrl: 'http://81.70.55.170:9999', // 微信的测试环境 +} + +module.exports = ENV_PATH \ No newline at end of file diff --git a/env/prod_xjzs.js b/env/prod_xjzs.js new file mode 100644 index 0000000..8044ed6 --- /dev/null +++ b/env/prod_xjzs.js @@ -0,0 +1,5 @@ +const ENV_PATH = { + baseUrl: 'https://hxz.quhouse.com', // 销讲助手 +} + +module.exports = ENV_PATH \ No newline at end of file diff --git a/env/self.js b/env/self.js new file mode 100644 index 0000000..7bc05d9 --- /dev/null +++ b/env/self.js @@ -0,0 +1,5 @@ +const ENV_PATH = { + baseUrl: 'http://127.0.0.1:9999', // 本地 +} + +module.exports = ENV_PATH \ No newline at end of file diff --git a/env/sh.js b/env/sh.js new file mode 100644 index 0000000..5d41014 --- /dev/null +++ b/env/sh.js @@ -0,0 +1,5 @@ +const ENV_PATH = { + baseUrl: 'http://192.168.31.149:9999', // 胜浩 +} + +module.exports = ENV_PATH \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..f352095 --- /dev/null +++ b/package.json @@ -0,0 +1,56 @@ +{ + "uni-app": { + "scripts": { + "weixin:self": { + "title": "本地ip", + "env": { + "UNI_PLATFORM": "mp-weixin", + "ENV_PATH": "@/env/self.js" + }, + "define": { + "WXCS-PLATFORM": true + } + }, + "weixin:cl": { + "title": "长龙ip", + "env": { + "UNI_PLATFORM": "mp-weixin", + "ENV_PATH": "@/env/cl.js" + }, + "define": { + "WXCS-PLATFORM": true + } + }, + "weixin:sh": { + "title": "胜浩ip", + "env": { + "UNI_PLATFORM": "mp-weixin", + "ENV_PATH": "@/env/sh.js" + }, + "define": { + "WXCS-PLATFORM": true + } + }, + "weixin:test": { + "title": "测试服务器", + "env": { + "UNI_PLATFORM": "mp-weixin", + "ENV_PATH": "@/env/dev.js" + }, + "define": { + "WXCS-PLATFORM": true + } + }, + "weixin:ai": { + "title": "AI销讲助手 生产", + "env": { + "UNI_PLATFORM": "mp-weixin", + "ENV_PATH": "@/env/prod_xjzs.js" + }, + "define": { + "WXSC-PLATFORM": true + } + }, + } + } +} diff --git a/utils/domain.js b/utils/domain.js index 360fa5b..1746acb 100644 --- a/utils/domain.js +++ b/utils/domain.js @@ -1,10 +1,7 @@ -const base = 'http://81.70.55.170:9999'; // 测试站 -// const base = 'http://127.0.0.1:9999'; // 本地 -// const base = 'http://192.168.31.149:9999' ;// 胜浩 -// const base = 'http://192.168.31.161:9999' // 长龙 -// const base = 'https://zanyong.hfju.com';// 正式 AI销管// 弃用 -// const base = 'https://hxz.quhouse.com';// 正式 AI销讲助手 - +/** + * env文件里配置自定义运行菜单每一个js代表一个域名 + */ +const base = process.env.ENV_PATH == undefined ? require('../env/dev.js') : require(process.env.ENV_PATH) // http.js使用 const baseUrl = `${base}/autoSR/api`; // config 使用