我试图使用Laravel和Vue从数据库中显示产品。
created(){
let uri=`http://127.0.0.1:8000/api/products`;
axios.get(uri).then((response)=>{
this.products=response.data
},
(error) => { console.log(JSON.stringify(error)) }
)
}
但是它给出了以下错误
{“ config”:{“ transformRequest”:{},“ transformResponse”:{},“超时”:0,“ xsrfCookieName”:“ XSRF-TOKEN”,“ xsrfHeaderName”:“ X-XSRF-TOKEN” ,“ maxContentLength”:-1,“标头”:{“ Accept”:“ application / json, 文字/纯文字, / “,” X-Requested-With“:” XMLHttpRequest“},” method“:” get“,” url“:” http://127.0.0.1:8000/api/products“},” request“:{} }