修复650、670长度字段00的异常,配置文件全部修改为生产环境
This commit is contained in:
@ -12,11 +12,11 @@ const config = {
|
|||||||
},
|
},
|
||||||
// 生产环境
|
// 生产环境
|
||||||
production: {
|
production: {
|
||||||
BASE_URL: 'https://fuyuanshen.com/backend',
|
BASE_URL: 'https://www.cnxhyc.com/jingquan',
|
||||||
API_PREFIX: '',
|
API_PREFIX: '',
|
||||||
// MQTT 配置
|
// MQTT 配置
|
||||||
MQTT_HOST: 'www.cnxhyc.com',
|
MQTT_HOST: 'www.cnxhyc.com',
|
||||||
MQTT_PORT: 8083,
|
MQTT_PORT: 9084,
|
||||||
MQTT_USERNAME: 'admin',
|
MQTT_USERNAME: 'admin',
|
||||||
MQTT_PASSWORD: '#YtvpSfCNG'
|
MQTT_PASSWORD: '#YtvpSfCNG'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name" : "星汉物联",
|
"name" : "星汉物联",
|
||||||
"appid" : "__UNI__A21EF43",
|
"appid" : "__UNI__A21EF43",
|
||||||
"description" : "设备管控",
|
"description" : "设备管控",
|
||||||
"versionName" : "1.0.1",
|
"versionName" : "1.0.2",
|
||||||
"versionCode" : "100",
|
"versionCode" : "100",
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
|
|||||||
@ -984,7 +984,7 @@
|
|||||||
|
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
// url: 'http://114.55.111.217/video/upload',
|
// url: 'http://114.55.111.217/video/upload',
|
||||||
url: baseURL+"app/video/upload",
|
url: baseURL + "app/video/upload",
|
||||||
filePath: videoPath,
|
filePath: videoPath,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
header: {
|
header: {
|
||||||
@ -1262,7 +1262,9 @@
|
|||||||
let arr = gbk.encode(text)
|
let arr = gbk.encode(text)
|
||||||
let gbkData = gbk.arr2hex(arr);
|
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 bufferSize = 5 + gbkData.length / 2; // 头部4字节 + 数据部分
|
||||||
const buffer = new ArrayBuffer(bufferSize);
|
const buffer = new ArrayBuffer(bufferSize);
|
||||||
@ -1272,7 +1274,8 @@
|
|||||||
dataView.setUint8(0, 0x55); // 帧头
|
dataView.setUint8(0, 0x55); // 帧头
|
||||||
dataView.setUint8(1, 0x03); // 帧类型:文字
|
dataView.setUint8(1, 0x03); // 帧类型:文字
|
||||||
dataView.setUint8(2, currentPacket.toString(16)); // 包序号
|
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;
|
let index = 0;
|
||||||
|
|||||||
@ -590,9 +590,9 @@
|
|||||||
that.formData.job = personnelInfo.position;
|
that.formData.job = personnelInfo.position;
|
||||||
that.formData.usrid = personnelInfo.code
|
that.formData.usrid = personnelInfo.code
|
||||||
}
|
}
|
||||||
that.formData.imei=res.deviceImei;
|
that.formData.imei = res.deviceImei;
|
||||||
these.device.deviceImei=res.deviceImei;
|
these.device.deviceImei = res.deviceImei;
|
||||||
if(that.formData.imei){
|
if (that.formData.imei) {
|
||||||
that.initMQ();
|
that.initMQ();
|
||||||
}
|
}
|
||||||
let dic = {
|
let dic = {
|
||||||
@ -2218,11 +2218,18 @@
|
|||||||
const buffer = new ArrayBuffer(bufferSize);
|
const buffer = new ArrayBuffer(bufferSize);
|
||||||
const dataView = new DataView(buffer);
|
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(0, 0x55); // 帧头
|
||||||
dataView.setUint8(1, 0x03); // 帧类型:文字
|
dataView.setUint8(1, 0x03); // 帧类型:文字
|
||||||
dataView.setUint8(2, currentPacket.toString(16)); // 包序号
|
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;
|
let index = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user