A question about axios cross-protocol requests

Project uses vue-cli family bucket. Since the project has just been upgraded from http to https, the axios, used for asynchronous request has been tested to see if there is a problem with API access. It is found that there is an inexplicable problem: the url of the
request will be preceded by a local domain name (this is local debugging, and if it is online debugging, it will bring the corresponding online domain name). Why?

clipboard.png

config/index.js


:


:

clipboard.png

Mar.28,2021

defaults to a relative path, such as axios.get ('/ api/login') . Now that you have used vue-cli, you are advised to configure proxyTable , do a proxy forwarding, and set it in the file config/index.js.

Menu