1.前端调用的api接口为匹配
proxy: { // 配置跨域
'/api': {//为匹配到次过滤
target: 'http://localhost:8081',
ws: true,
changOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
2.接口服务器对应端口未启用
Proxy error: Could not proxy request /login from localhost:8080 to http://localhost:8081 (ECONNREFUSED).