jy-qrcode-app/config/common.js

153 lines
3.1 KiB
JavaScript
Raw Normal View History

2025-11-06 15:40:06 +08:00
const getServiceHost = api => {
const apimodules = [{
2025-11-12 10:04:44 +08:00
OP: 5116
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
BD: 5101
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
DD: 5102
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
EA: 5103
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
ED: 5104
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
EM: 5105
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
FC: 5106
2025-11-06 15:40:06 +08:00
},
{
2025-11-12 10:04:44 +08:00
FM: 5107
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
KR: 5108
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
LG: 5109
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
MR: 5110
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
NW: 5111
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
PF: 5112
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
PM: 5113
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
QC: 5114
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
FW: 5115
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
OP: 5116
2025-11-06 15:40:06 +08:00
},
{
2025-11-12 10:04:44 +08:00
HM: 5117
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
PP: 5118
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
FO: 5119
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
UT: 5177
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
BS: 5178
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
SC: 5179
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
TI: 5179
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
SE: 5179
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
AE: 5179
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
PT: 5179
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
LR: 5179
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
OG: 5179
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
PE: 5179
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
OH: 5179
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
CM: 5179
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
PR: 5179
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
DM: 5179
2025-11-06 15:40:06 +08:00
}, {
2025-11-12 10:04:44 +08:00
BI: 5179
2025-11-06 15:40:06 +08:00
}
]
2025-11-12 10:04:44 +08:00
let port = 5112
2025-11-06 15:40:06 +08:00
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}`
}
// 发行APP前先确定要发布的版本
2025-11-13 10:35:41 +08:00
let APP_ENV = 'beta' // release: 发行版 debug:开发环境 beta: 测试版
2025-11-06 15:40:06 +08:00
let configURL
if (APP_ENV === "dev") {
//本地环境
configURL = {
web_name: "",
serviceHost(api) {
const apis = getServiceHost(api)
return `${this.uni_app_web_api_url}:${apis}` //测试环境
},
uni_app_web_url: "", //
uni_app_web_api_url: "http://localhost", // 请求接口的地址
2025-11-12 10:04:44 +08:00
uni_app_web_source_url: "http://localhost:5199", // 资源地址
2025-11-06 15:40:06 +08:00
uni_app_web_local_api_url: "http://localhost", // 请求接口的地址
2025-11-13 10:35:41 +08:00
uni_app_url: "http://121.41.2.71:5100",
qrcode_url: "http://121.41.2.71:5111"
2025-11-06 15:40:06 +08:00
}
} else if (APP_ENV === "beta") {
//测试环境
configURL = {
web_name: "",
serviceHost(api) {
const apis = getServiceHost(api)
return `${this.uni_app_web_api_url}:${apis}` //测试环境
},
uni_app_web_url: "", //
uni_app_web_api_url: "http://121.41.2.71", // 请求接口的地址
2025-11-12 10:04:44 +08:00
uni_app_web_source_url: "http://121.41.2.71:5199", // 资源地址
2025-11-06 15:40:06 +08:00
uni_app_web_local_api_url: "http://121.41.2.71", // 请求接口的地址
2025-11-13 10:35:41 +08:00
uni_app_url: "http://121.41.2.71:5100",
qrcode_url: "http://121.41.2.71:5111"
2025-11-06 15:40:06 +08:00
}
} else if (APP_ENV === "release") {
//正式环境
configURL = {
web_name: "",
serviceHost(api) {
const apis = getServiceHost(api)
return `${this.uni_app_web_local_api_url}:${apis}`
},
uni_app_web_url: "",
2025-11-12 10:04:44 +08:00
uni_app_web_api_url: "http://124.117.209.78",
uni_app_web_source_url: "http://124.117.209.78:5199",
2025-11-13 10:35:41 +08:00
qrcode_url: "http://124.117.209.78:5111",
uni_app_url: "http://124.117.209.78:5100",
2025-11-12 10:04:44 +08:00
uni_app_web_local_api_url: "http://124.117.209.78"
2025-11-06 15:40:06 +08:00
}
} else {
//开发 debug
configURL = {
web_name: "",
serviceHost(api) {
const apis = getServiceHost(api)
return `${this.uni_app_web_local_api_url}:${apis}`
},
uni_app_web_url: "",
uni_app_web_api_url: "http://121.41.2.71",
2025-11-13 13:56:35 +08:00
uni_app_web_source_url: "http://121.41.2.71:5199", //附件
2025-11-13 10:35:41 +08:00
qrcode_url: "http://121.41.2.71:5111", //生成二维码
uni_app_url: "http://121.41.2.71:5100", //跳转进入app
2025-11-06 15:40:06 +08:00
uni_app_web_local_api_url: "http://localhost" //打包测试: 121.41.2.71 开发可 localhost
}
}
export default configURL