Vue-cli3配置proxy

  1. vue.config.js配置如下

    devServer: {
            proxy: {
                '.action': {
                    target: 'http://xxx.xxx.net', // 接口的域名
                    changeOrigin: true
                }
            }
        }
  2. 请求如下

     this.axios.post('/user/login.action',{
              CompanyName,
              UserPass,
              UserName
           })
  3. 报错如下

    Proxy error: Could not proxy request /user/login.action from localhost:8080 to http://xxx.xxx.net.
    See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ETIMEDOUT).
  4. postman能调通 求问是什么问题
阅读 8.8k
2 个回答

'.action':
这个地方写成正则表达式

你好,请问后来问题解决了吗?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题