This commit is contained in:
wyw 2026-01-28 14:03:56 +08:00
parent cdc9a135fb
commit 24c70ee6a3

View File

@ -1,94 +1,100 @@
const getServiceHost = api => { const getServiceHost = api => {
const apimodules = [{
OP: 3116
}, {
BD: 3101
}, {
DD: 3102
}, {
EA: 3103
}, {
ED: 3104
}, {
EM: 3105
}, {
FC: 3106
},
{
FM: 3107
}, {
KR: 3108
}, {
LG: 3109
}, {
MR: 3110
}, {
NW: 3111
}, {
PF: 3112
}, {
PM: 3113
}, {
QC: 3114
}, {
FW: 3115
}, {
OP: 3116
},
{
HM: 3117
}, {
PP: 3118
}, {
FO: 3119
}, {
UT: 3177
}, {
BS: 3178
}, {
SC: 3179
}, {
TI: 3179
}, {
SE: 3179
}, {
AE: 3179
}, {
PT: 3179
}, {
LR: 3179
}, {
OG: 3179
}, {
PE: 3179
}, {
OH: 3179
}, {
CM: 3179
}, {
PR: 3179
}, {
DM: 3179
}, {
BI: 3179
}
]
let port = 3112 let port = 3112
for (let i = 0; i < apimodules.length; i++) { if (APP_ENV == 'release') {
const apimodule = apimodules[i] port = 3000
const key = Object.keys(apimodule)[0] } else {
if (api.indexOf(`/${key}/`) > -1) { const apimodules = [{
port = apimodule[key] OP: 3116
break }, {
BD: 3101
}, {
DD: 3102
}, {
EA: 3103
}, {
ED: 3104
}, {
EM: 3105
}, {
FC: 3106
},
{
FM: 3107
}, {
KR: 3108
}, {
LG: 3109
}, {
MR: 3110
}, {
NW: 3111
}, {
PF: 3112
}, {
PM: 3113
}, {
QC: 3114
}, {
FW: 3115
}, {
OP: 3116
},
{
HM: 3117
}, {
PP: 3118
}, {
FO: 3119
}, {
UT: 3177
}, {
BS: 3178
}, {
SC: 3179
}, {
TI: 3179
}, {
SE: 3179
}, {
AE: 3179
}, {
PT: 3179
}, {
LR: 3179
}, {
OG: 3179
}, {
PE: 3179
}, {
OH: 3179
}, {
CM: 3179
}, {
PR: 3179
}, {
DM: 3179
}, {
BI: 3179
}
]
let port = 3112
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${api}` return `${port}/api${api}`
} }
// 发行APP前先确定要发布的版本 // 发行APP前先确定要发布的版本
let APP_ENV = 'beta' // release: 发行版 debug:开发环境 beta: 测试版 //process.env.CUSTOM_PLATFORM APP_ENV
let APP_ENV = 'Test' // release: 发行版 debug:开发环境 beta: 测试版
let configURL let configURL
if (process.env.CUSTOM_PLATFORM === "dev") { if (APP_ENV === "dev") { //process.env.CUSTOM_PLATFORM
//本地环境 //本地环境
configURL = { configURL = {
web_name: "", web_name: "",
@ -103,7 +109,7 @@ if (process.env.CUSTOM_PLATFORM === "dev") {
uni_app_url: "http121.41.2.71:9100", uni_app_url: "http121.41.2.71:9100",
qrcode_url: "http://121.41.2.71:9201" qrcode_url: "http://121.41.2.71:9201"
} }
} else if (process.env.CUSTOM_PLATFORM === "beta") { } else if (APP_ENV === "beta") {
//测试环境 //测试环境
configURL = { configURL = {
web_name: "", web_name: "",
@ -118,7 +124,7 @@ if (process.env.CUSTOM_PLATFORM === "dev") {
uni_app_url: "http://121.41.2.71:9100", uni_app_url: "http://121.41.2.71:9100",
qrcode_url: "http://121.41.2.71:9201" qrcode_url: "http://121.41.2.71:9201"
} }
} else if (process.env.CUSTOM_PLATFORM === "release") { } else if (APP_ENV === "release") {
//正式环境 //正式环境
configURL = { configURL = {
web_name: "", web_name: "",
@ -127,11 +133,11 @@ if (process.env.CUSTOM_PLATFORM === "dev") {
return `${this.uni_app_web_local_api_url}:${apis}` return `${this.uni_app_web_local_api_url}:${apis}`
}, },
uni_app_web_url: "", uni_app_web_url: "",
uni_app_web_api_url: "http://xmmhe.com", uni_app_web_api_url: "http://sps.cxtc.com",
uni_app_web_source_url: "http://xmmhe.com:3199", uni_app_web_source_url: "http://sps.cxtc.com:3199",
qrcode_url: "http://xmmhe.com:9201", qrcode_url: "http://sps.cxtc.com:9201",
uni_app_url: "http://xmmhe.com:9100", uni_app_url: "http://sps.cxtc.com:9100",
uni_app_web_local_api_url: "http://xmmhe.com" uni_app_web_local_api_url: "http://sps.cxtc.com"
} }
} else { } else {
//开发 debug //开发 debug
@ -142,10 +148,10 @@ if (process.env.CUSTOM_PLATFORM === "dev") {
return `${this.uni_app_web_local_api_url}:${apis}` return `${this.uni_app_web_local_api_url}:${apis}`
}, },
uni_app_web_url: "", uni_app_web_url: "",
uni_app_web_api_url: "http://121.41.2.71", uni_app_web_api_url: "http://localhost",
uni_app_web_source_url: "http://121.41.2.71:3199", //附件 uni_app_web_source_url: "http://localhost:3199", //附件
qrcode_url: "http://121.41.2.71:9201", //生成二维码 qrcode_url: "http://localhost:9201", //生成二维码
uni_app_url: "http://121.41.2.71:9100", //跳转进入app uni_app_url: "http://localhost:9100", //跳转进入app
uni_app_web_local_api_url: "http://localhost" //打包测试: 121.41.2.71 开发可 localhost uni_app_web_local_api_url: "http://localhost" //打包测试: 121.41.2.71 开发可 localhost
} }
} }