亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

php - vue-resource's get request cannot send parameters
天蓬老師
天蓬老師 2017-06-29 10:08:18
0
2
1060

Using the vue framework, paired with vue-resource, the code is posted below. The interface on the landing page uses post requests. Everything is normal. You can pass parameters and receive return values, but on this page, you cannot use get to pass them. Parameters (the parameters received by php are null), please help....

js part:

this.$http.get('/operation/customer/question/edits',{id: 10}).then(response => {
    this.question = response.body.data;
},response => {
    this.error('連接錯誤');
})

php part:

public function edits(Request $request){
    dd($request->all());  //這里在前臺控制臺返回的是接收到的參數(shù),得到的結果一直為[]
    extract($request->all());
    $question=Question::find($id);
    return ApiHelper::Response(0,'success',$question);
}

天蓬老師
天蓬老師

歡迎選擇我的課程,讓我們一起見證您的進步~~

reply all(2)
扔個三星炸死你

Vue GET transfer parameters must be added with params

this.$http.get('/operation/customer/question/edits',{params:{id: 10}})

In addition, VUE officially recommends using axios vue-resource and it will not be updated

阿神

It is recommended to use axios

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template