zhuguifei
2025-07-25 85a15646ffe20ed2bbb2042ec500df8c850a69cc
common/api.js
@@ -1,16 +1,19 @@
import {
   fly
} from '@/common/request/fly.js'
//配置请求基地址
fly.config.baseURL = "http://192.168.12.20:9999"
const url = uni.getStorageSync('baseurl');
if (url) {
   fly.config.baseURL = url + "/herb"
}
const mqttBaseUrl = "223.241.221.20";
const emqxBaseUrl = "http://"+mqttBaseUrl +":18083/api/v5"
} from '@/common/request/fly.js'
const base = "http://192.168.21.3:9999"
// const base = "https://lanpucloud.cn"
//配置请求基地址
fly.config.baseURL = base + ""
const ip = uni.getStorageSync('lan_ip');
if (ip) {
   fly.config.baseURL = "http://" + ip + ":9999"
}
const mqttBaseUrl = "lanpucloud.cn";
const emqxBaseUrl =  base + ":1883/api/v5";
// 测试
function test(params) {
   return fly.get('/test/jeecgDemo/queryById', params);
@@ -37,11 +40,17 @@
function getOrderList(params) {
   fly.config.loading = true
   return fly.get('/dry/dryOrder/list', params);
}
//设备列表
function queryEquList(params){
   fly.config.loading = true
   return fly.get('/mobile/equ/list', params);
}
//设备列表
function queryEquList(params) {
   fly.config.loading = true
   return fly.get('/mobile/equ/list', params);
}
//仅用作下拉刷新,无实际意义
function querySampleList(params) {
   fly.config.loading = true
   return fly.get('/mobile/sample/list', params);
}
//
@@ -53,20 +62,32 @@
function sendCommand(params) {
   fly.config.loading = true
   return fly.post('/dry/real/sendCommand', params);
}
//emqx 接口
}
//历史故障,查询最近数据
function queryHisFaultList(params) {
   fly.config.loading = true
   return fly.get('/mobile/fault/list', params);
}
//历史故障,查询图表需要数据
function queryHisFaultChartList(params) {
   fly.config.loading = true
   return fly.get('/mobile/fault/chart', params);
}
//emqx 接口
function emqxClients() {
   fly.config.loading = true
   return fly.get(emqxBaseUrl + "/clients", {
      auth: {
        username: "a3dc6758f6abc41a",
        password: "FvBwJcmqhAuQ0aBg4FLl5gQA9A9BE64bpl0oJTg9A6I0bK"
      },
      headers: {
      'Content-Type': 'application/json',
    },
   return fly.get(emqxBaseUrl + "/clients", {
      auth: {
         username: "a3dc6758f6abc41a",
         password: "FvBwJcmqhAuQ0aBg4FLl5gQA9A9BE64bpl0oJTg9A6I0bK"
      },
      headers: {
         'Content-Type': 'application/json',
      },
   });
}
@@ -77,11 +98,14 @@
   login,
   getRealTimeData,
   getAnalyList,
   getOrderList,
   getOrderList,
   queryEquList,
   querySampleList,
   queryHisFaultList,
   queryHisFaultChartList,
   getMonth,
   sendCommand,
   emqxClients,
   sendCommand,
   emqxClients,
   mqttBaseUrl
}