From 0152f045cc53d5d1db1ddebc1b5dae5da6e3ce3b Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期三, 17 九月 2025 15:11:36 +0800
Subject: [PATCH] 新增后台自动更新配置

---
 Monitor-APP/pages/home/home.vue |   56 ++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/Monitor-APP/pages/home/home.vue b/Monitor-APP/pages/home/home.vue
index 7948851..150e223 100644
--- a/Monitor-APP/pages/home/home.vue
+++ b/Monitor-APP/pages/home/home.vue
@@ -408,6 +408,9 @@
 				baseLedId: '',
 				baseCrnId: '',
 				baseUrl: '',
+				apiIp: '178.18.1.203',
+				apiPort: '9090',
+				apiUrl: 'tlfwcs',
 				info: null,
 				error: null,
 				infoType: 0,
@@ -479,6 +482,8 @@
 			}, 500)
 		},
 		onLoad() {
+			this.getLedInfos()
+			
 			setInterval(() => {
 				this.getDate2()
 				this.getUrl()
@@ -503,6 +508,25 @@
 				var result = ycqdata.carError
 				var res = result.data
 				that.carInfoModel(res)
+			},
+			getLedInfos() {
+				let that = this
+				uni.request({
+					url: that.baseHttp + that.apiIp + ":" + that.apiPort + "/" + that.apiUrl + "/console/getLedInfos",
+					method: "GET",
+					data: {},
+					success(result) {
+						var res = result.data
+						let data = res.data;
+						
+						uni.setStorageSync('BaseIp', that.apiIp);
+						uni.setStorageSync('BaseLedId', data.staArr);
+						uni.setStorageSync('BasePort', that.apiPort);
+						uni.setStorageSync('BaseCrnId', data.crnId);
+						uni.setStorageSync('UPROJ', that.apiUrl);
+						this.getUrl()
+					}
+				})
 			},
 			carInfoModel(res) {
 				let infoList = []
@@ -562,21 +586,21 @@
 					that.infoType = 0
 				}
 			},
-			getInfo() {
-				let that = this
-				uni.request({
-					url: that.commonUrl + "/monitor/led",
-					method: "GET",
-					data: {
-						ledId: that.baseLedId
-					},
-					success(result) {
-						var res = result.data
-						that.infoModel(res)
-					}
-				})
+			// getInfo() {
+			// 	let that = this
+			// 	uni.request({
+			// 		url: that.commonUrl + "/monitor/led",
+			// 		method: "GET",
+			// 		data: {
+			// 			ledId: that.baseLedId
+			// 		},
+			// 		success(result) {
+			// 			var res = result.data
+			// 			that.infoModel(res)
+			// 		}
+			// 	})
 
-			},
+			// },
 			getError() {
 				let that = this
 				uni.request({
@@ -870,10 +894,6 @@
 				}
 				uni.request({
 					url: that.commonUrl + "/monitor/loc/rep",
-					data: {
-						crnId: that.baseCrnId,
-						ledId: that.baseLedId,
-					},
 					method: 'GET',
 					success(result) {
 						var res = result.data

--
Gitblit v1.9.1