guifei zhu
2024-09-18 ba616e9307681da4781b7610ec3c27721d793379
common/api.js
@@ -2,12 +2,14 @@
   fly
} from '@/common/request/fly.js'
//配置请求基地址
fly.config.baseURL = "http://192.168.2.6:8800/herb"
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"
// 测试
function test(params) {
@@ -36,7 +38,11 @@
   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 getMonth(params) {
@@ -50,6 +56,20 @@
}
//emqx 接口
function emqxClients() {
   fly.config.loading = true
   return fly.get(emqxBaseUrl + "/clients", {
      auth: {
        username: "a3dc6758f6abc41a",
        password: "FvBwJcmqhAuQ0aBg4FLl5gQA9A9BE64bpl0oJTg9A6I0bK"
      },
      headers: {
      'Content-Type': 'application/json',
    },
   });
}
export default {
@@ -58,6 +78,10 @@
   getRealTimeData,
   getAnalyList,
   getOrderList,
   queryEquList,
   getMonth,
   sendCommand
   sendCommand,
   emqxClients,
   mqttBaseUrl
}