国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

php – Die Get-Anfrage von vue-resource kann keine Parameter senden
天蓬老師
天蓬老師 2017-06-29 10:08:18
0
2
1065

Bei Verwendung des Vue-Frameworks mit Vue-Ressource wird der Code unten ver?ffentlicht. Alles ist normal. Sie k?nnen jedoch keine Parameter mit get übergeben (Der von PHP empfangene Parameter ist null), bitte helfen Sie ...

js Teil:

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

php-Teil:

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

天蓬老師
天蓬老師

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

Antworte allen(2)
扔個三星炸死你

vue GET傳遞參數(shù)要加上params

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

另外說一句,現(xiàn)在VUE官方推薦使用axios vue-resource不更新了

阿神

建議使用 axios

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage