Vue-Proxy error: Could not proxy request xxx/xxx from localhost:9528 to http://ip:port
问题vue项目启动后登录报如下错误:App running at:- Local:http://localhost:9528/- Network: http://192.168.100.26:9528/Proxy error: Could not proxy request /model/list from localhost:9528 to http://xxxxx:9090/xxxx.See
·
问题
vue项目启动后登录报如下错误:
App running at:
- Local: http://localhost:9528/
- Network: http://192.168.100.26:9528/
Proxy error: Could not proxy request /model/list from localhost:9528 to http://xxxxx:9090/xxxx.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).
是代理服务器出了问题,可能是当前配置的代理服务器关闭了或者配置错误,在vue.config.js文件中,将target改成正确的已开启的服务器地址即可(可以让后端开发人员开启一下服务器)
proxy: {
// 代理服务器设置
'/my_test_proxy': {
target: 'xxx:xxx', // 需要将目前的地址代理至target
changeOrigin: true,
pathRewrite: {
['^' + '/my_test_proxy']: '' // 将'/my_test_proxy' 重写为''
}
}
}
参考
Proxy error: Could not proxy request
https://www.cnblogs.com/wwqzbl/p/15200209.html
更多推荐
已为社区贡献2条内容
所有评论(0)