Javascript Vuejs和Laravel发送数据不工作

Javascript Vuejs和Laravel发送数据不工作,javascript,laravel-5.1,vue.js,Javascript,Laravel 5.1,Vue.js,我有一个vue.js脚本,它获取一个csv,将其发送到我的服务器端代码,然后将其分解成一个数组并发送回 现在,我将数据保存到一个数组中,以便客户端可以编辑任何数据并操作ect。以下是执行此操作的代码: //hide the upload box, and display new message $('#upload').slideUp(); $('#message').html('Cheers, Just give us a sec to decode the file...'); //get

我有一个vue.js脚本,它获取一个csv,将其发送到我的服务器端代码,然后将其分解成一个数组并发送回

现在,我将数据保存到一个数组中,以便客户端可以编辑任何数据并操作ect。以下是执行此操作的代码:

//hide the upload box, and display new message
$('#upload').slideUp();
$('#message').html('Cheers, Just give us a sec to decode the file...');

//get the file and save it into a new File Object ready to send
var files = $('input#csvUpload').prop('files');
var csv_file = new FormData();
csv_file.append('csv_file', files[0]);


//send to a controller that will read this file and return a JSON string!
this.$http.post('uploadCSV', csv_file, function(data){
   //the data is the array returned from the controller,
   //this function is just the call back

   //now for the rows
   this.rows    = data.rows;

   console.log(this.rows);

   //update the message with some new instructions
   $('#message').html("Done, now remove the cards you don't want to process");

   //and show our table
   $('#table').slideDown();

    });

现在,一切正常。这没什么错。令人困惑的是,在最终用户完成更改后,我需要将该数据发送给一个控制器,该控制器将处理该数据。 但问题是,当我发送数据时,当它到达控制器时,laravel似乎无法找到它

发送数据的代码:

  this.$http.post('makePayment', this.rows, function(data){
     this.processed = data;
     console.log(data);
   });
$array = $request->all();
return $array;
exit();

控制器代码:

  this.$http.post('makePayment', this.rows, function(data){
     this.processed = data;
     console.log(data);
   });
$array = $request->all();
return $array;
exit();

我有一种感觉,它正盯着我的脸看,但这真的让我很困惑,上图显示了
this.rows
对象中的内容


感谢您事先提供的帮助好吧,我知道它正盯着我的脸。因此,解决方案非常简单。发生的事情是,我发送的是一个数组而不是json字符串……这不重要吧?是的。因此,简单的解决方案是在将数据发送到控制器之前,我需要将数组转换为Json格式

下面是发送我的数据的更新代码:

var newJson = JSON.stringify(this.rows);
this.$http.post('makePayment', newJson, function(data){
      this.processed = data;
      console.log(data);
});