去除部分调试打印,优化环境变量控制,修复再来一单只有一个商品时自动弹出图片预览问题,
This commit is contained in:
@@ -1,29 +1,38 @@
|
||||
// const debug = process.env.NODE_ENV == 'development' ? true : false;
|
||||
const debug = false; // false线上 true本地
|
||||
// #ifdef H5
|
||||
const proxyApi = "/api";
|
||||
// #endif
|
||||
let baseUrl = ''
|
||||
let baseUrlwws = ''
|
||||
|
||||
// #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,
|
||||
};
|
||||
|
||||
function init(){
|
||||
if (debug) {
|
||||
baseUrl = 'http://192.168.1.42'
|
||||
baseUrlwws = "ws://192.168.1.42:2348";
|
||||
} else {
|
||||
baseUrl = 'https://cashier.sxczgkj.com'
|
||||
baseUrlwws = "wss://czgeatws.sxczgkj.com/wss";
|
||||
}
|
||||
// #ifdef H5
|
||||
|
||||
if (debug) {
|
||||
baseUrl = "/api";
|
||||
baseUrlwws = "http://192.168.1.42:2348";
|
||||
} else {
|
||||
baseUrl = "/prodApi";
|
||||
baseUrlwws = "https://czgeatws.sxczgkj.com/wss";
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
|
||||
init()
|
||||
|
||||
uni.conf = {
|
||||
debug,
|
||||
baseUrl,
|
||||
@@ -36,10 +45,10 @@ uni.conf = {
|
||||
export const changeEnv = (env) => {
|
||||
if (env === "test") {
|
||||
let baseUrl = "http://192.168.1.42"
|
||||
let baseUrlwws="ws://192.168.1.42:2348"
|
||||
let baseUrlwws = "ws://192.168.1.42:2348"
|
||||
// #ifdef H5
|
||||
baseUrl = "/api"
|
||||
baseUrlwws="http://192.168.1.42:2348"
|
||||
baseUrlwws = "http://192.168.1.42:2348"
|
||||
// #endif
|
||||
uni.conf = {
|
||||
debug: true,
|
||||
@@ -52,9 +61,13 @@ export const changeEnv = (env) => {
|
||||
};
|
||||
}
|
||||
if (env === "prod") {
|
||||
let baseUrl = "https://cashier.sxczgkj.com"
|
||||
// #ifdef H5
|
||||
baseUrl = "/prodApi"
|
||||
// #endif
|
||||
uni.conf = {
|
||||
debug: false,
|
||||
baseUrl: "https://cashier.sxczgkj.com",
|
||||
baseUrl,
|
||||
version: 100,
|
||||
autoRemoveCache,
|
||||
baseUrlwws: "wss://czgeatws.sxczgkj.com/wss",
|
||||
|
||||
Reference in New Issue
Block a user