首先360wcnm
我安装了半天一直失败,我寻思着我也没出错啊,查了半天,百度也google也找,都没啥人和我一个毛病,最后看到一个老哥说,你把360关了试试。。我真是一口血吐出来了。
在测试时发现新版本charles不支持本地抓取 网上参考
https://blog.csdn.net/weixin_43735348/article/details/100824002
将localhost改成了 http://localhost.charlesproxy.com/
在js文件中这样引用
componentDidMount(){
axios.get('http://localhost.charlesproxy.com:3000/api/todolist')
.then((res)=>{
console.log(res.data);
this.setState(()=>({
list:[...res.data]
}))
})
.catch(()=>{alert('fail')})
}