bug修复,mqtt添加默认值;请求后端三则运算,设备状态变更完善
parent
8cc77d2852
commit
01bece15cc
|
|
@ -1,8 +1,6 @@
|
|||
// 应用全局配置
|
||||
module.exports = {
|
||||
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
|
||||
baseUrl: 'http://172.14.24.109:8088',
|
||||
// baseUrl: 'http://1.94.254.176:8088',
|
||||
baseUrl: "production" ? "/api" : "http://localhost:8088",
|
||||
// 应用信息
|
||||
appInfo: {
|
||||
// 应用名称
|
||||
|
|
|
|||
|
|
@ -521,6 +521,12 @@ export default {
|
|||
if (allKeysNumeric) {
|
||||
// console.info(msgData)
|
||||
this.status = {...msgData}
|
||||
// 3. 遍历msgData的所有键,根据值设置this.show的对应文本
|
||||
Object.keys(msgData).forEach(key => {
|
||||
const value = msgData[key];
|
||||
// 判断值:0→暂停,1→运行,其他值可补充默认值(可选)
|
||||
this.show[key] = value === 0 ? '暂停' : '运行';
|
||||
});
|
||||
// console.info("imei: "+this.publishTopic+"copy: ",this.status)
|
||||
}
|
||||
const allKeysNumeric2 = Object.keys(msgData).every(key => /^\d+$/.test(key));
|
||||
|
|
|
|||
|
|
@ -238,10 +238,10 @@ export default {
|
|||
return {
|
||||
// MQTT配置
|
||||
mqttConfig: {
|
||||
broker: '', // 公共测试服务器
|
||||
broker: 'ws://1.94.254.176:9001/mqtt', // 公共测试服务器
|
||||
clientId: 'uniapp_mqtt_' + Math.random().toString(16).substr(2, 8),
|
||||
username: '',
|
||||
password: '',
|
||||
username: 'admin',
|
||||
password: 'Admin#12345678',
|
||||
timeout: 30
|
||||
},
|
||||
// 连接状态
|
||||
|
|
|
|||
Loading…
Reference in New Issue