Proxy error: Could not proxy request

vue项目启动后登录报如下错误:

是代理服务器出了问题,可能是当前配置的代理服务器关闭了或者配置错误,在vue.config.js文件中,将target改成正确的已开启的服务器地址即可(可以让后端开发人员开启一下服务器)

proxy: {
  // 代理服务器设置
  '/my_test_proxy': {
    target: 'xxx:xxx', // 需要将目前的地址代理至target
    changeOrigin: true,
    pathRewrite: {
      ['^' + '/my_test_proxy']: '' // 将'/my_test_proxy' 重写为''
    }
  }
}
原文地址:https://www.cnblogs.com/wwqzbl/p/15200209.html