diff --git a/vue.config.js b/vue.config.js index bc5a895..15f40ea 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,48 +1,53 @@ module.exports = { - css: { - loaderOptions: { - } - }, - configureWebpack: { - performance: { - hints: false + css: { + loaderOptions: { + } }, - devServer: { - host: '0.0.0.0', - port: 8002, - contentBase: ['./node_modules', './public'], - publicPath: '/', - disableHostCheck: true, - proxy: { - '/api': { - // target: `http://localhost:8080/`, // 本地开发环境 - target: `http://218.59.175.43:92`, // 内网测试环境 - // target: `http://116.255.223.226:8082/nsgk_test/`, // 公网测试环境 - // target: `http://192.168.0.105:8090`, // 公网测试环境 - changeOrigin: true, - onProxyReq: function (proxyReq, req) { - console.log( - '[HPM] Origin changed from ' + - req.headers.host + - ' ~> ' + - proxyReq.getHeader('host') - ); - } + configureWebpack: { + performance: { + hints: false }, - '/geoserver': { - target: 'http://localhost:37300', - logLevel: 'debug', - changeOrigin: true, - onProxyReq: function (proxyReq, req) { - console.log( - '[HPM] Origin changed from ' + - req.headers.host + - ' ~> ' + - proxyReq.getHeader('host') - ); - } + devServer: { + host: '0.0.0.0', + port: 8002, + contentBase: ['./node_modules', './public'], + publicPath: '/', + disableHostCheck: true, + proxy: { + '/api': { + // target: `http://localhost:8080/`, // 本地开发环境 + // target: `http://218.59.175.43:92`, // 内网测试环境 + // target: `http://218.59.175.44:8082/nsgk_test/`, // 公网测试环境 + // target: `http://eqixingguan.nongshen.net/`, // 公网测试环境 + // target: `http://218.59.175.44:99/gz_qixing/`, // 七星关 + target: `http://218.59.175.44:99/dengzhoushi/`, // 邓州 + changeOrigin: true, + pathRewrite: { + '^/api': '' + }, + onProxyReq: function (proxyReq, req) { + console.log( + '[HPM] Origin changed from ' + + req.headers.host + + ' ~> ' + + proxyReq.getHeader('host') + ); + } + }, + '/geoserver': { + target: 'http://localhost:37300', + logLevel: 'debug', + changeOrigin: true, + onProxyReq: function (proxyReq, req) { + console.log( + '[HPM] Origin changed from ' + + req.headers.host + + ' ~> ' + + proxyReq.getHeader('host') + ); + } + } + } } - } } - } };