1. Configure proxy tables to solve cross-domain problems
Module. exports = {lintOnSave: fales,// Disable eslint check assetsDir: 'static', devServer: {HTTPS: true,// allow HTTPS proxy: {'/GW': {ws: false, //target: 'http://10.111.116.8:xxx/', // test (use your own test environment) target: 'http://10.111.117.10:xxx/', / / formal (with your own formal environment) changeOrigin: true, pathRewrite: {' ^ / GW: '}}}},}Copy the code
Two, only need to modify the following three places when using:
1. Create a vue.config.js file in the project folder. The name of the file is fixed and cannot be changed.
2. Copy the above configuration code into the vue.confing.js file you created.
3, modify the need to change;
(1) Test server address: change “http://10.111.116.8:xxx/” to the test server address of your project;
(2) the formal server address: “http://10.111.117.10:xxx/” to your project’s official server address;
(3) “/GW” : replace the name of the nginx agent configured by the project background or operation and maintenance; (This can be done by asking the backend or operations, or asking the backend to configure “/GW” to the nginx file for you.) (Both ‘/GW’ need to be modified)