diff --git a/config/index.js b/config/index.js index d093640..a0bcd76 100644 --- a/config/index.js +++ b/config/index.js @@ -12,11 +12,11 @@ const config = { }, // 生产环境 production: { - BASE_URL: 'https://fuyuanshen.com/backend', + BASE_URL: 'https://www.cnxhyc.com/jingquan', API_PREFIX: '', // MQTT 配置 MQTT_HOST: 'www.cnxhyc.com', - MQTT_PORT: 8083, + MQTT_PORT: 9084, MQTT_USERNAME: 'admin', MQTT_PASSWORD: '#YtvpSfCNG' } diff --git a/manifest.json b/manifest.json index 9c4cb37..7fe5bd7 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name" : "星汉物联", "appid" : "__UNI__A21EF43", "description" : "设备管控", - "versionName" : "1.0.1", + "versionName" : "1.0.2", "versionCode" : "100", "transformPx" : false, /* 5+App特有相关 */ diff --git a/pages/650/HBY650.vue b/pages/650/HBY650.vue index e203ce1..ec02911 100644 --- a/pages/650/HBY650.vue +++ b/pages/650/HBY650.vue @@ -984,7 +984,7 @@ uni.uploadFile({ // url: 'http://114.55.111.217/video/upload', - url: baseURL+"app/video/upload", + url: baseURL + "app/video/upload", filePath: videoPath, name: 'file', header: { @@ -1148,7 +1148,7 @@ }, closePop: function() { this.Status.Pop.showPop = false; - + if (this.Status.Pop.cancelCallback) { this.Status.Pop.cancelCallback(); } @@ -1262,7 +1262,9 @@ let arr = gbk.encode(text) let gbkData = gbk.arr2hex(arr); - + let s = (text.length * 2).toString(16); + let len = String(s).padStart(4, '0') + len = len.match(/.{1,2}/g); // 构建数据包 const bufferSize = 5 + gbkData.length / 2; // 头部4字节 + 数据部分 const buffer = new ArrayBuffer(bufferSize); @@ -1272,7 +1274,8 @@ dataView.setUint8(0, 0x55); // 帧头 dataView.setUint8(1, 0x03); // 帧类型:文字 dataView.setUint8(2, currentPacket.toString(16)); // 包序号 - dataView.setUint16(3, (text.length * 2).toString(16)); // 数据长度 + dataView.setUint8(3, parseInt('0x' + len[0], 16)); // 数据长度 + dataView.setUint8(4, parseInt('0x' + len[1], 16)); // 数据长度 // 填充数据 let index = 0; diff --git a/pages/670/HBY670.vue b/pages/670/HBY670.vue index b539446..ec4f0e6 100644 --- a/pages/670/HBY670.vue +++ b/pages/670/HBY670.vue @@ -590,9 +590,9 @@ that.formData.job = personnelInfo.position; that.formData.usrid = personnelInfo.code } - that.formData.imei=res.deviceImei; - these.device.deviceImei=res.deviceImei; - if(that.formData.imei){ + that.formData.imei = res.deviceImei; + these.device.deviceImei = res.deviceImei; + if (that.formData.imei) { that.initMQ(); } let dic = { @@ -2218,11 +2218,18 @@ const buffer = new ArrayBuffer(bufferSize); const dataView = new DataView(buffer); + let s = (text.length * 2).toString(16); + let len = String(s).padStart(4, '0') + len = len.match(/.{1,2}/g); + // 填充头部 dataView.setUint8(0, 0x55); // 帧头 dataView.setUint8(1, 0x03); // 帧类型:文字 dataView.setUint8(2, currentPacket.toString(16)); // 包序号 - dataView.setUint16(3, (text.length * 2).toString(16)); // 数据长度 + dataView.setUint8(3, parseInt('0x' + len[0], 16)); // 数据长度 + dataView.setUint8(4, parseInt('0x' + len[1], 16)); // 数据长度 + + // 填充数据 let index = 0;