fix json error912
This commit is contained in:
14
server.js
14
server.js
@ -144,13 +144,17 @@ app.post('/csv', (req, res, next) => {
|
||||
fs.createReadStream(path)
|
||||
.pipe(parse({ delimiter: ",", from_line: 2 }))
|
||||
.on("data", function (row) {
|
||||
for (i = 0; i < row.length; ++i){
|
||||
console.log("--- r-0 ----", row[i]);
|
||||
if(row[i][0] === _userEmail){
|
||||
console.log("--- r-0 ----", row[0]);
|
||||
if(row[0] === _userEmail){
|
||||
_res = r[2];
|
||||
break;
|
||||
}
|
||||
}
|
||||
// for (i = 0; i < row.length; ++i){
|
||||
// console.log("--- r-0 ----", row[i]);
|
||||
// if(row[i][0] === _userEmail){
|
||||
// _res = r[2];
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
if(_res === ""){
|
||||
fs.appendFile(path, csv, function (err) {
|
||||
|
||||
Reference in New Issue
Block a user