mh_jy_safe_web/src/config.js
2025-10-01 18:30:21 +08:00

105 lines
3.2 KiB
JavaScript

const getServiceHost = api => {
const apimodules = [{ OP: 5116 }, { BD: 5101 }, { DD: 5102 }, { EA: 5103 }, { ED: 5104 }, { EM: 5105 }, { FC: 5106 },
{ FM: 5107 }, { KR: 5108 }, { LG: 5109 }, { MR: 5110 }, { NW: 5111 }, { PF: 5112 }, { PM: 5113 }, { QC: 5114 }, { FW: 5115 },
{ HM: 5117 }, { PP: 5118 }, { FO: 5119 }, { UT: 5177 }, { BS: 5178 }, { SC: 5179 }, { TI: 5179 }, { SE: 5179 }, { AE: 5179 }, { PT: 5179 }, { LR: 5179 }, { OG: 5179 }, { PE: 5179 }, { OH: 5179 }, { CM: 5179 }, { PR: 5179 }, { DM: 5179 }, { BI: 5179 }, { TL: 5179 }, { WB: 5179 }, { PC: 5179 }, { SK: 5180 }]
let port = 5112
for (let i = 0; i < apimodules.length; i++) {
const apimodule = apimodules[i]
const key = Object.keys(apimodule)[0]
if (api.indexOf(`/${key}/`) > -1) {
port = apimodule[key]
break
}
}
return `${port}/${api}`
}
let version = 2025081903;
const config = {
local: {
serviceHost: api => {
const apis = getServiceHost(api)
return `http://localhost:${apis}`
},
cookieDomain: "",
flowServiceHost: "http://120.25.146.31:3188/",
hmiUrl: "http://localhost:8060/",
webSocketHost: 'ws://localhost:3140/',
picServerHost: 'http://localhost:5199',
dataVUrl: "http://localhost:8062/home",
version: version,
guideSeverHost: "http://121.41.2.71/apk/",
guideH5Host: "http://121.41.2.71:9100/",
h5Web: "http://121.41.2.71:9201/",
},
cloud: {
serviceHost: api => {
const apis = getServiceHost(api)
return `http://120.25.146.31:${apis}`
},
flowServiceHost: "http://120.25.146.31:3188",
cookieDomain: "",
hmiUrl: "http://120.25.146.31:8098/",
webSocketHost: 'ws://120.25.146.31:3140/',
picServerHost: 'http://120.25.146.31:5199',
dataVUrl: "http://120.25.146.31:3167/home",
version: version,
guideSeverHost: "http://www.xmmhe.com/apk/",
guideH5Host: "http://www.xmmhe.com:9100/",
h5Web: "http://www.xmmhe.com:9201/",
},
test: {
serviceHost: api => {
const apis = getServiceHost(api)
return `http://121.41.2.71:${apis}`
},
flowServiceHost: "http://121.41.2.71:3188",
cookieDomain: "",
hmiUrl: "http://121.41.2.71:8098/",
webSocketHost: 'ws://121.41.2.71:3140/',
picServerHost: 'http://121.41.2.71:5199',
dataVUrl: "http://121.41.2.71:3167/home",
version: version,
guideSeverHost: "http://121.41.2.71/apk/",
guideH5Host: "http://121.41.2.71:9100/",
h5Web: "http://121.41.2.71:9201/",
},
}
let env = ""
switch (window.location.host) {
case "120.25.146.31":
case "120.25.146.31:5000":
case "120.25.146.31:5001":
case "120.25.146.31:5002":
case "120.25.146.31:5003":
case "120.25.146.31:5004":
case "www.xmmhe.com":
case "www.xmmhe.com:5000":
case "www.xmmhe.com:5001":
case "www.xmmhe.com:5002":
case "www.xmmhe.com:5003":
case "www.xmmhe.com:5004":
case "xmmhe.com":
case "xmmhe.com:5000":
case "xmmhe.com:5001":
case "xmmhe.com:5002":
case "xmmhe.com:5003":
case "xmmhe.com:5004":
case "xmmhe.com:5005":
env = "cloud"
break
case "121.41.2.71:5000":
case "121.41.2.71:5001":
case "121.41.2.71:5002":
case "121.41.2.71:5003":
case "121.41.2.71:5004":
env = "test"
break
default:
env = "local"
break
}
export default config[env]