会员展示问题修复,本地开发工具增加环境切换判断
This commit is contained in:
54
common/config.js
Normal file
54
common/config.js
Normal file
@@ -0,0 +1,54 @@
|
||||
// const debug = process.env.NODE_ENV == 'development' ? true : false;
|
||||
const debug = false;
|
||||
// #ifdef H5
|
||||
const proxyApi = "/api";
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN || APP || MP-ALIPAY
|
||||
const proxyApi = "http://192.168.1.42"; // 调试地址
|
||||
const proxyApiwws = "ws://192.168.1.42:2348"; // 调试地址
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
const baseUrl = debug ? proxyApi : "http://192.168.1.42";
|
||||
const baseUrlwws = "ws://192.168.1.42:2348";
|
||||
// #endif
|
||||
|
||||
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
|
||||
const baseUrl = debug ? proxyApi : "https://cashier.sxczgkj.com"; // 线上
|
||||
const baseUrlwws = debug ? proxyApiwws : "wss://czgeatws.sxczgkj.com/wss"; // 线上
|
||||
// #endif
|
||||
|
||||
const version = "100";
|
||||
const autoRemoveCache = {
|
||||
count: 100000,
|
||||
size: 100000,
|
||||
};
|
||||
uni.conf = {
|
||||
debug,
|
||||
baseUrl,
|
||||
version,
|
||||
autoRemoveCache,
|
||||
baseUrlwws,
|
||||
};
|
||||
|
||||
export const changeEnv = (env) => {
|
||||
if (env === "test") {
|
||||
uni.conf = {
|
||||
debug: true,
|
||||
baseUrl: "http://192.168.1.42",
|
||||
version: 100,
|
||||
autoRemoveCache,
|
||||
baseUrlwws: "ws://192.168.1.42:2348",
|
||||
};
|
||||
}
|
||||
if (env === "prod") {
|
||||
uni.conf = {
|
||||
debug: false,
|
||||
baseUrl: "https://cashier.sxczgkj.com",
|
||||
version: 100,
|
||||
autoRemoveCache,
|
||||
baseUrlwws: "wss://czgeatws.sxczgkj.com/wss",
|
||||
};
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user