react 通过 package.json 实现跨域
在 package.json 中添加 proxy:
"proxy": "http://106.13.9.213:9000"

页面中调用:
async componentDidMount() {
let res = await axios.get('/admin/category');
console.log(res);
}
.
在 package.json 中添加 proxy:
"proxy": "http://106.13.9.213:9000"

页面中调用:
async componentDidMount() {
let res = await axios.get('/admin/category');
console.log(res);
}
.