1配置写错
proxyTable: {
‘/api’: {
target: ‘localhost:8081’,//设置你调用的接口域名和端口号
changeOrigin: true, //跨域
pathRewrite: {
‘^/api’: ‘/’
}
}
改为
proxyTable: {
‘/api’: {
target: ‘http://localhost:8081’,//设置你调用的接口域名和端口号
changeOrigin: true, //跨域
pathRewrite: {
‘^/api’: ‘/’
}
}
2node没更新
npm -g install npm ( 会更新到最新稳定版 )
3后台API服务没开
4粗心,npm run dev之后去git push代码了,然后没有重新npm install再运行就报错
5你看看是不是前端后端起的不是同一个项目