zhuguifei
2025-07-04 186d172fc06dfe44dc2a61d238356e6a7db652d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import {
    fly
} from '@/common/request/fly.js'
//配置请求基地址
fly.config.baseURL = "http://lanpucloud.cn/herb"
const ip = uni.getStorageSync('lan_ip');
if (ip) {
    fly.config.baseURL = "http://" + ip + ":9999"
}
 
const mqttBaseUrl = "lanpucloud.cn";
const emqxBaseUrl = "http://" + mqttBaseUrl + ":1883/api/v5"
 
// 测试
function test(params) {
    return fly.get('/test/jeecgDemo/queryById', params);
}
 
function login(params) {
    fly.config.loading = true
    return fly.post('/sys/mLogin', params);
}
 
//实时数据
function getRealTimeData(params) {
    fly.config.loading = false
    return fly.get('/dry/real/getRealTimeData', params);
}
 
//分析数据
function getAnalyList(params) {
    fly.config.loading = true
    return fly.get('/dry/dryResult/list', params);
}
 
//订单数据
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 querySampleList(params) {
    fly.config.loading = true
    return fly.get('/mobile/sample/list', params);
}
 
//
function getMonth(params) {
    fly.config.loading = true
    return fly.get('/dry/dryOrder/monthOverview', params);
}
 
function sendCommand(params) {
    fly.config.loading = true
    return fly.post('/dry/real/sendCommand', params);
}
 
//历史故障,查询最近数据
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',
        },
    });
}
 
 
 
export default {
    test,
    login,
    getRealTimeData,
    getAnalyList,
    getOrderList,
    queryEquList,
    querySampleList,
    queryHisFaultList,
    queryHisFaultChartList,
    getMonth,
    sendCommand,
 
    emqxClients,
    mqttBaseUrl
}