【发布时间】:2020-09-25 12:21:21
【问题描述】:
这是一个 react 项目,我收到以下错误,我为 Axios 创建了一个单独的文件夹,该文件的代码在下面给出,然后我导入它,
import axios from 'axios';
const instance = axios.create({
baseURL: 'https://burger-builder-urro.firebaseio.com/'
});
export default instance;
下面是我要发布数据的另一个文件的代码:
purchasecontinuedHandler= ()=>{
// alert("You Continue");
const order = {
ingredients: this.state.ingredients,
price: this.state.totalprice,
customer : {
name: "Mubarra",
address: {
street: 'Teststreet 1',
zipcode: '9382',
country: 'pakistan'
},
email: 'mubarraajmal.uet@gmail.com'
},
deliveryMethod : 'fastest'
}
axios.post('/orders.json', order)
.then(response => console.log(response))
.catch(error => console.log(error));
}
我真的不知道为什么会显示这个错误:
【问题讨论】:
标签: reactjs firebase firebase-realtime-database react-redux