guifei zhu
2024-11-27 6017f46b762663b9393cdae8422e0de1ed3db218
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) {
@@ -35,8 +37,12 @@
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 getMonth(params) {
@@ -47,8 +53,22 @@
function sendCommand(params) {
   fly.config.loading = true
   return fly.post('/dry/real/sendCommand', params);
}
//emqx 接口
function emqxClients() {
   fly.config.loading = true
   return fly.get(emqxBaseUrl + "/clients", {
      auth: {
        username: "a3dc6758f6abc41a",
        password: "FvBwJcmqhAuQ0aBg4FLl5gQA9A9BE64bpl0oJTg9A6I0bK"
      },
      headers: {
      'Content-Type': 'application/json',
    },
   });
}
@@ -57,7 +77,11 @@
   login,
   getRealTimeData,
   getAnalyList,
   getOrderList,
   getOrderList,
   queryEquList,
   getMonth,
   sendCommand
   sendCommand,
   emqxClients,
   mqttBaseUrl
}