Home  >  Q&A  >  body text

javascript - In vue-cli, proxyTable is used to achieve cross-domain. There is no problem with get access, but there is a problem when passing data through post.

The vue-cli scaffolding is used in the project for development, in which proxyTable is used to implement cross-domain and axios is used to send requests.
But during the project process, there is no problem using the get method to request and the data can be obtained. However, there is a problem when using post parameters to obtain the data. Please ask the master, wait online, urgent... .

This is a request sent by the browser network


.]
This is the proxy setting

After some debugging, it seems that the reverse proxy did not proxy the parameters

習慣沉默習慣沉默2678 days ago1075

reply all(3)I'll reply

  • 天蓬老师

    天蓬老师2017-07-05 10:47:20

    Try using Postman first.

    Theoretically speaking, proxyTable only acts as a reverse proxy and does not affect the call.

    There should be an error in the way the backend obtains data.

    reply
    0
  • 習慣沉默

    習慣沉默2017-07-05 10:47:20

    Troubleshoot the error, use IDE tools such as postman, simulate the request with post, and see if the background can receive it

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-07-05 10:47:20

    You can capture the packet and see if there is any data returned. After all, the stateCode is 200 (but there may be other status identification codes). If not, take another look: where are the parameters during the request and whether the parameters were successfully written during the request. .

    reply
    0
  • Cancelreply