lihaiCenter/config/app.js

72 lines
2.0 KiB
JavaScript
Raw Normal View History

2023-10-08 14:17:20 +08:00
// #ifdef H5
let VUE_APP_WS_URL = `ws://${location.hostname}?type=user`
// #endif
2023-10-11 10:01:28 +08:00
const MD5KEY = 'AK9F3AD3A7498A236D0DB76604CF1F3EA3'
2023-10-08 14:17:20 +08:00
let openPlantGrass = '-openPlantGrass-'
let httpApi
// 在打包之前请检查当前环境是否正确
const env = 'dev'; // 开发
// const env = 'prod'; // 生产
// const env = 'prew'; // 预上线
switch (env) {
case 'prod':
2023-10-11 10:01:28 +08:00
httpApi = 'https://middle.lihaink.cn' // 生产
2023-10-08 14:17:20 +08:00
break;
case 'prew':
2023-10-11 10:01:28 +08:00
httpApi = 'https://preview-middle.lihaink.cn' //预发布环境
2023-10-08 14:17:20 +08:00
break;
default:
2023-10-11 10:01:28 +08:00
httpApi = "https://ceshi-middle.lihaink.cn" // 测试
2023-10-08 14:17:20 +08:00
}
// 聊天接口修改此字符 小程序聊天要求wss 例如wss://mer.crmeb.net
// let wsApi = 'ws://192.168.3.20:8324'
let wsApi = 'wss://shop.lihaink.cn'
module.exports = {
// 请求域名 格式: https://您的域名
// #ifdef MP || APP-PLUS
HTTP_REQUEST_URL: httpApi,
2023-10-11 10:01:28 +08:00
// HTTP_REQUEST_URL_TWO: httpApiTwo,
// HTTP_REQUEST_URL_THREE: httpApiThree,
// HTTP_REQUEST_URL_FOUR: httpApiFour,
2023-10-08 14:17:20 +08:00
VUE_APP_WS_URL: `${wsApi}?type=user`,
// #endif
// #ifdef H5
//H5接口是浏览器地址
HTTP_REQUEST_URL: httpApi || window.location.protocol + "//" + window.location.host,
2023-10-11 10:01:28 +08:00
// HTTP_REQUEST_URL_FOUR: httpApiFour|| window.location.protocol + "//" + window.location.host,
// HTTP_REQUEST_URL_TWO: httpApiTwo || window.location.protocol + "//" + window.location.host,
2023-10-08 14:17:20 +08:00
// 聊天长连接地址
VUE_APP_WS_URL: wsApi ? `${wsApi}?type=user` : VUE_APP_WS_URL,
// #endif
2023-10-11 10:01:28 +08:00
MD5KEY: MD5KEY,
2023-10-08 14:17:20 +08:00
openPlantGrass: openPlantGrass,
HEADER: {
2023-10-11 10:01:28 +08:00
// 'content-type': 'application/json',
'appid': 'AD1696910250',
'url': 'https://middle.lihaink.cn',
'timestamp': Date.now(),
2023-10-08 14:17:20 +08:00
//#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
},
// 回话密钥名称 请勿修改此配置
2023-10-11 10:01:28 +08:00
TOKENNAME: 'token',
2023-10-08 14:17:20 +08:00
// 缓存时间 0 永久
EXPIRE: 0,
};