From 7941623b1fb108a154ea4270d7c7e2df6031f6e5 Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei@zhuguifeideiMac.local>
Date: 星期四, 11 十二月 2025 12:36:14 +0800
Subject: [PATCH] 优化页面UI更新
---
common/api.js | 137 +++++++++++++++++++++++++++++++++++++--------
1 files changed, 111 insertions(+), 26 deletions(-)
diff --git a/common/api.js b/common/api.js
index bb159dc..6e13ab0 100644
--- a/common/api.js
+++ b/common/api.js
@@ -1,27 +1,112 @@
-import {fly} from '@/common/request/fly.js'
- //閰嶇疆璇锋眰鍩哄湴鍧�
-fly.config.baseURL= "https://dev.shlanbao.cn:8800/herb"
-
-// 娴嬭瘯
-function test(params) {
- return fly.get('/test/jeecgDemo/queryById',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);
-}
-
-
-
-
+import {
+ fly
+} from '@/common/request/fly.js'
+// const base = "http://192.168.21.3:9999"
+const base = "http://lanpucloud.cn"
+
+//閰嶇疆璇锋眰鍩哄湴鍧�
+fly.config.baseURL = base + "/herb"
+// 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);
+}
+
+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,
- getRealTimeData,
- getAnalyList
-}
+ test,
+ login,
+ getRealTimeData,
+ getAnalyList,
+ getOrderList,
+ queryEquList,
+ querySampleList,
+ queryHisFaultList,
+ queryHisFaultChartList,
+ getMonth,
+ sendCommand,
+
+ emqxClients,
+ mqttBaseUrl
+}
\ No newline at end of file
--
Gitblit v1.9.3