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.
習慣沉默
習慣沉默 2017-07-05 10:45:20
0
3
1103

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

習慣沉默
習慣沉默

reply all(3)
Peter_Zhu

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.

習慣沉默

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

仅有的幸福

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. .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template