How to dynamically modify background URL and deal with cross-domain problems in Vue project

modify the url that accesses the backend after the vue project is packaged

one way on the Internet is to leave a configuration file in static when packing, but the configuration file can only modify the settings in axios, so there is no way to cross domains

is there a way to modify url after packaging without affecting cross-domain problems

Apr.09,2021

implement it uniformly when cross-domain deployment is needed. The local proxy is because node does a layer of proxy, which must not be used after packaging.


seeing the questions I asked when I was a child, I suddenly felt that I was cute and stupid at that time

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-1b3e49c-2c3f3.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-1b3e49c-2c3f3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?