diff --git a/src/controllers/server.js b/src/controllers/server.js index d46a355..d66aea8 100644 --- a/src/controllers/server.js +++ b/src/controllers/server.js @@ -635,8 +635,7 @@ const server = { for(let i = 0; i < len; i++){ arr.push(JSON.stringify(addData[i])); } - - eval('data.splice(' + st_i + ', 0, ' + arr.join(",") + ')'); + new Function("data","return " + 'data.splice(' + st_i + ', 0, ' + arr.join(",") + ')')(data); } else{ file["column"] += len; diff --git a/src/global/extend.js b/src/global/extend.js index 0949e67..ce5d7a5 100644 --- a/src/global/extend.js +++ b/src/global/extend.js @@ -713,14 +713,14 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) { if(direction == "lefttop"){ if(index == 0){ - new Function("return " + 'd.unshift(' + arr.join(",") + ')')(); + new Function("d","return " + 'd.unshift(' + arr.join(",") + ')')(d); } else{ - new Function("return " + 'd.splice(' + index + ', 0, ' + arr.join(",") + ')')(); + new Function("d","return " + 'd.splice(' + index + ', 0, ' + arr.join(",") + ')')(d); } } else{ - new Function("return " + 'd.splice(' + (index + 1) + ', 0, ' + arr.join(",") + ')')(); + new Function("d","return " + 'd.splice(' + (index + 1) + ', 0, ' + arr.join(",") + ')')(d); } } else {