明树Git Lab

Commit 1dbff31f authored by zfp1's avatar zfp1

update

parent 0bd73827
......@@ -87,16 +87,19 @@ function genInsertObj(gbkString, deviceNumber) {
let arr = [];
for (let index = 0; index < splitArr.length; index++) {
let element = splitArr[index];
console.log(element.startsWith('{'), !element.endsWith('}'), element.slice(0, -2), element)
if (element.startsWith('{')) {
if (!element.endsWith('}')) {
element = element.slice(0, -2);
let nStr = element.substring(0, element.length - 2);
arr.push(nStr)
} else {
arr.push(element)
}
arr.push(element)
}
}
console.log(arr, "---------------------")
console.log(arr, "===========")
let obj = {
deviceNumber: deviceNumber,
time: new Date(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment