shop-applet/config/app.js

81 lines
2.4 KiB
JavaScript
Raw Normal View History

2023-09-20 17:00:55 +08:00
// #ifdef H5
let VUE_APP_WS_URL = `ws://${location.hostname}?type=user`
// #endif
let openPlantGrass = '-openPlantGrass-'
let httpApi
let httpApiTwo
let httpApiThree
2023-11-09 19:03:49 +08:00
let wsApi
2023-09-20 18:16:59 +08:00
2023-09-26 20:41:49 +08:00
// 在打包之前请检查当前环境是否正确
2024-02-05 17:50:08 +08:00
const env = 'dev'; // 开发
// const env = 'prod'; // 生产
2023-09-26 20:41:49 +08:00
// const env = 'prew'; // 预上线
2023-09-20 17:00:55 +08:00
2023-09-26 20:41:49 +08:00
switch (env) {
case 'prod':
httpApi = 'https://shop.lihaink.cn' // 生产
httpApiTwo = 'https://nk.lihaink.cn'
httpApiThree = 'http://ceshi-oa.lihaink.cn'
httpApiFour = 'https://worker-task.lihaink.cn'
2023-11-09 19:03:49 +08:00
wsApi = 'wss://shop.lihaink.cn'
2023-09-26 20:41:49 +08:00
break;
case 'prew':
httpApi = 'https://test.shop.lihaink.cn' //预发布环境
httpApiTwo = "https://nk.lihaink.cn"
httpApiThree = 'http://ceshi-oa.lihaink.cn'
httpApiFour = 'https://preview-worker-task.lihaink.cn'
2023-11-09 19:03:49 +08:00
wsApi = 'wss://test.shop.lihaink.cn'
2023-09-26 20:41:49 +08:00
break;
default:
httpApi = "https://crmeb-test.shop.lihaink.cn" // 测试
httpApiTwo = "https://nk.lihaink.cn"
httpApiThree = 'http://ceshi-oa.lihaink.cn'
httpApiFour = 'https://ceshi-worker-task.lihaink.cn'
2023-11-09 19:03:49 +08:00
httpApiFive = 'https://ceshi-zhibo.lihaink.cn'
wsApi = 'wss://crmeb-test.shop.lihaink.cn'
2023-09-20 17:00:55 +08:00
}
2023-09-26 20:41:49 +08:00
2023-09-20 17:00:55 +08:00
// 聊天接口修改此字符 小程序聊天要求wss 例如wss://mer.crmeb.net
2023-11-09 19:03:49 +08:00
// wsApi = 'ws://192.168.1.17:8324'
let wsApi_one = 'wss://ceshi-zhibo.lihaink.cn/chat_room'
2023-09-20 17:00:55 +08:00
module.exports = {
2023-11-09 19:03:49 +08:00
ENV: env,
2023-09-20 17:00:55 +08:00
// 请求域名 格式: https://您的域名
// #ifdef MP || APP-PLUS
// HTTP_REQUEST_URL: httpApi,
HTTP_REQUEST_URL: httpApi,
HTTP_REQUEST_URL_TWO: httpApiTwo,
HTTP_REQUEST_URL_THREE: httpApiThree,
2023-09-26 20:41:49 +08:00
HTTP_REQUEST_URL_FOUR: httpApiFour,
2023-09-20 17:00:55 +08:00
VUE_APP_WS_URL: `${wsApi}?type=user`,
// #endif
2023-11-09 19:03:49 +08:00
2023-09-20 17:00:55 +08:00
// #ifdef H5
//H5接口是浏览器地址
2023-11-09 19:03:49 +08:00
HTTP_REQUEST_URL_FOUR: httpApiFour || window.location.protocol + "//" + window.location.host,
2023-09-20 17:00:55 +08:00
HTTP_REQUEST_URL: httpApi || window.location.protocol + "//" + window.location.host,
HTTP_REQUEST_URL_TWO: httpApiTwo || window.location.protocol + "//" + window.location.host,
// 聊天长连接地址
VUE_APP_WS_URL: wsApi ? `${wsApi}?type=user` : VUE_APP_WS_URL,
// #endif
openPlantGrass: openPlantGrass,
HEADER: {
'content-type': 'application/json',
//#ifdef H5
'Form-type': navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1 ? 'wechat' : 'h5',
//#endif
//#ifdef MP
'Form-type': 'routine',
//#endif
//#ifdef APP-PLUS
'Form-type': 'app',
//#endif
},
// 回话密钥名称 请勿修改此配置
TOKENNAME: 'X-Token',
// 缓存时间 0 永久
EXPIRE: 0,
};