Vue axios request to automatically bring the current domain name?

clipboard.png

clipboard.png

clipboard.png

ask for answers from all kinds of gods


this is not the same concept as proxytable, proxytable is just a cross-domain processing scheme under dev (node environment).
if it is a production environment, nginx/apache is generally used to proxy the domain name port to be consistent with the URL of the front-end static file. In the
code, you don't need a domain name when you use axios to request an API such as / path/resturl . When you request an interface like < domain > / path/resturl < / domain >, you will naturally bring the domain name and port of the browser's URL address.
in this way, under dev, you no longer need to replace the domain name of the interface in the code when you deploy in the proxytable; production environment.


are you.

http: / / 127.0.0.1/xxx/xxxx lost both bars


request address is written as a relative path, right?
localhost/xxxxxx
preceded by http (s): / / or /


is not the current domain name automatically brought by vue, but by the browser.


when encapsulating axios request, add baseURL


MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c2428d-336c0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c2428d-336c0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?