After vue build packs and generates a configuration file, modify the public ip path externally

1. The first step: Create a xxx folder and a xxx.js file in the dist
2. The second step: Create several variables in the created js file
insert image description here
3. The third step introduces the js file path in the dist
insert image description here
4. Change the ip path written in the previous package
insert image description here
to this

window.UrlListIp=UrlListIp //服务器onemap接口地址    服务器
window.UrlBigIp =UrlBigIp //服务器测试接口地址
window.geoserverIp =geoserverIp //geoserver地址
window.getRealTimeVideo = getRealTimeVideo
window.userlogon = userlogon//登录接口

In this way, after packaging the package, you can see the js file just created in the dist, so that others can change the ip path

Guess you like

Origin blog.csdn.net/qq_48203828/article/details/129382071