关于axios跨域问题的解决,
Access to XMLHttpRequest at 'http://localhost:3000/books/4' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
首先再node里面安装cors中间件输入命令 npm install cors,
然后然后添加 const cors=require('cors') //导入
app.user(cors()) //注册
大概这样子