| .env.development | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| .env.production | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/utils/healthCheck.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
.env.development
@@ -5,13 +5,13 @@ ENV = 'development' # 智云迈思L-MOM管理系统/开发环境 VUE_APP_BASE_API = http://localhost:81/API/ # VUE_APP_BASE_API = http://localhost:81/API/ # VUE_APP_BASE_API = 'http://47.96.97.237/API/' # VUE_APP_BASE_API = 'http://220.189.218.155:9010/API/' # VUE_APP_BASE_API = 'http://localhost:8082/LuBaoAPI/' #锦隆 # # VUE_APP_BASE_API_INNER = 'http://192.168.1.11/API/' # # VUE_APP_BASE_API = http://61.174.29.234:8880/API/ VUE_APP_BASE_API_INNER = http://192.168.1.11/API/ VUE_APP_BASE_API = http://61.174.29.234:8880/API/ # 宁波 四维尔 # VUE_APP_BASE_API_INNER = http://192.168.0.236:9010/API/ # VUE_APP_BASE_API = http://220.189.218.155:9010/API/ @@ -19,6 +19,6 @@ # VUE_APP_BASE_API = http://localhost:8082/API/ # 内网地址测试 # VUE_APP_BASE_API_INNER = http://192.168.1.11/API/ VUE_APP_BASE_API_INNER = http://192.168.1.11/API/ # VUE_APP_BASE_API_INNER = http://192.168.1.11/API/ # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true .env.production
@@ -5,11 +5,11 @@ ENV = 'production' # 宁波 四维尔 VUE_APP_BASE_API_INNER = http://192.168.0.236:9010/API/ VUE_APP_BASE_API = http://220.189.218.155:9010/API/ # VUE_APP_BASE_API_INNER = http://192.168.0.236:9010/API/ # VUE_APP_BASE_API = http://220.189.218.155:9010/API/ # 余姚 锦隆 智能家居 # VUE_APP_BASE_API_INNER = http://192.168.1.11/API/ # VUE_APP_BASE_API = http://61.174.29.234:8880/API/ VUE_APP_BASE_API_INNER = http://192.168.1.11/API/ VUE_APP_BASE_API = http://61.174.29.234:8880/API/ # 智云迈思L-MOM管理系统/生产环境 # VUE_APP_BASE_API = http://47.96.97.237/API/ #杜贺 src/utils/healthCheck.js
@@ -50,17 +50,23 @@ */ export const findAvailableService = async () => { // 并行检测所有服务(提高效率) const healthCheckPromises = serviceList.map((item) => { return checkServiceHealth(item) }); const healthResult = await Promise.any(healthCheckPromises); // 检测到健康的链接就立刻返回 // 筛选可用的 baseUrl const availableBaseUrl = healthResult try { const healthCheckPromises = serviceList.map((item) => { return checkServiceHealth(item) }); const healthResult = await Promise.all(healthCheckPromises); // 检测到健康的链接就立刻返回 // 筛选可用的 baseUrl console.log(healthResult) const availableBaseUrl = healthResult.filter((item)=>item!=null)[0] if (availableBaseUrl) { return availableBaseUrl; } else { // 所有服务均不可用,抛出异常(后续在初始化时捕获) throw new Error("所有服务健康检查失败,请检查服务状态或网络配置"); if (availableBaseUrl) { return availableBaseUrl; } else { // 所有服务均不可用,抛出异常(后续在初始化时捕获) throw new Error("所有服务健康检查失败,请检查服务状态或网络配置"); } }catch(err) { throw err; } };