After vue configures proxyTable, the interface invoked in the production environment becomes the server + porxyTable configured interface.

"http://shuijibook.com" apisproxyTableproxyTable

config/index.js

http://interview.nsntc.com + api

:apisapis,


then add'/ apis/' 'when you need to visit


there should be no problem with the configuration. Drop the code when calling and see if / apis

has been added.

http://blog.csdn.net/u0123692.


Please learn about nginx server:

servervue-clinpm run buildnginxnginx

use nginx's reverse proxy mechanism to solve the front-end cross-domain problem

take a look at the main question again: there are already answers in other answers. Use:

when sending axios requests.
axios.post('/apis/xxxx')

be sure to act as a proxy when deploying to the server, otherwise interface 404

will appear.

encountered the same problem. How did the landlord solve the problem?


https://codeshelper.com/q/10.

my answer in this may explain your doubts

Menu