Issues related to the packaging of Vue projects.

the front-end rookie has just done a vue project in the company, which is packaged and put on the Tomcat server. Because the backend request IP and port number need to be modified at will after packaging, according to the online method, a serverconfig.json configuration file is generated, in which IP and port number are configured.

![][1]
{


}
IP

clipboard.png
the IP and port number in the configuration file obtained here have not been modified.

whether this cache can set an expiration time in the code, or if there is any other way to solve this problem.

Mar.30,2021

you can add a timestamp or a random number when loading

$.ajax({
    url: 'serverconfig.json?r=' + (new Date().getTime())
})
Menu