| | |
| | | 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"
|
| | | 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) {
|
| | |
| | | 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);
|
| | | }
|
| | |
|
| | | //
|
| | |
| | | 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',
|
| | | },
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | login,
|
| | | getRealTimeData,
|
| | | getAnalyList,
|
| | | getOrderList, |
| | | getOrderList,
|
| | | queryEquList,
|
| | | querySampleList,
|
| | | queryHisFaultList,
|
| | | queryHisFaultChartList,
|
| | | getMonth,
|
| | | sendCommand, |
| | | |
| | | emqxClients, |
| | | sendCommand,
|
| | |
|
| | | emqxClients,
|
| | | mqttBaseUrl
|
| | | } |