Vue cli configuration proxytable failure

  1. the address I want to request is http://192.168.2.125:8080/WX/user/WXRegister
  2. .
  3. the Proxytable I configured is as follows
    proxyTable: {

     "/api": {
    
       target:"http://192.168.2.125:8080", 
    
       changeOrigin:true,
    
       pathRewrite: {
         "^/api": ""
       }
     }

    },

  4. the axios I requested is as follows
    this.axios ({

    )
     method:"post",
     url:"/api/WX/user/WXRegister",
    data:{
       ...obj,
       sign:getSign(obj)
       

    }
    }) .then (res= > {

    )
     console.log(res,"")

    })

  5. then the page reports the following error
    POST :8080/api/WX/user/WXRegister 504 (Gateway Timeout)

5. The console reported the following error
[HPM] Error occurred while trying to proxy request / WX/user/WXRegister
from localhost:8080 to http://192.168.2.125:8080 (ECONNREFUSED) ( https://nodejs.org/api/errors.

ask for advice!

Aug.24,2021

check the firewall and turn off the firewall on this machine.


Cross-domain configuration is correct, and the backend is responsible!

Menu