Invalid vue setting ProxyTable

recently, when I was working on a vue project, I encountered a cross-domain problem. ProxyTable was used as a proxy on the Internet and was set up in accordance with the steps, but it seemed that the code did not go. ProxyTable, found a URL test because it did not respond to its own server, and found that it was still the same. Please take a look at it. Here is the code:

clipboard.png

clipboard.png

clipboard.png

Mar.04,2021

you have written something wrong

pathRewrite: {
  '^/apis': '/'
}

or'/'at the end of the target address

< hr >

I just wrote a try and found that you are the requested Mr. Ruan's page =
here I want to use the
that get,post will report an error. Post the code I wrote
where to configure proxy

.
'/emsTest': {
    target: 'http://es6.ruanyifeng.com',
    changeOrigin: true,
    pathRewrite: {
      '^/emsTest': '/'
    }
}

js code of the request

testUrl () {
  let self = this
  self.$axios.get('/emsTest/-sharpdocs/let')
  .then(res => {
    console.log(res)
  })
}

Screenshot of console output:
clipboard.png

if ps: uses someone else's interface, if you don't know the request method, use get, by default. If you really want to find the post test API, you can find those provided in the api test website and post a portal: https://www.sojson.com/api/we.

.

same question
I did "npm run dev" again. And then it's ready.

Menu