bug修复,mqtt添加默认值;请求后端三则运算,设备状态变更完善

master
lld 2025-12-30 17:27:38 +08:00
parent 8cc77d2852
commit 01bece15cc
3 changed files with 10 additions and 6 deletions

View File

@ -1,8 +1,6 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api', baseUrl: "production" ? "/api" : "http://localhost:8088",
baseUrl: 'http://172.14.24.109:8088',
// baseUrl: 'http://1.94.254.176:8088',
// 应用信息 // 应用信息
appInfo: { appInfo: {
// 应用名称 // 应用名称

View File

@ -521,6 +521,12 @@ export default {
if (allKeysNumeric) { if (allKeysNumeric) {
// console.info(msgData) // console.info(msgData)
this.status = {...msgData} this.status = {...msgData}
// 3. msgDatathis.show
Object.keys(msgData).forEach(key => {
const value = msgData[key];
// 01
this.show[key] = value === 0 ? '暂停' : '运行';
});
// console.info("imei: "+this.publishTopic+"copy: ",this.status) // console.info("imei: "+this.publishTopic+"copy: ",this.status)
} }
const allKeysNumeric2 = Object.keys(msgData).every(key => /^\d+$/.test(key)); const allKeysNumeric2 = Object.keys(msgData).every(key => /^\d+$/.test(key));

View File

@ -238,10 +238,10 @@ export default {
return { return {
// MQTT // MQTT
mqttConfig: { mqttConfig: {
broker: '', // broker: 'ws://1.94.254.176:9001/mqtt', //
clientId: 'uniapp_mqtt_' + Math.random().toString(16).substr(2, 8), clientId: 'uniapp_mqtt_' + Math.random().toString(16).substr(2, 8),
username: '', username: 'admin',
password: '', password: 'Admin#12345678',
timeout: 30 timeout: 30
}, },
// //