diff --git a/src/utils/request.js b/src/utils/request.js index 3b9cda1..755b9eb 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -22,7 +22,7 @@ const service = axios.create({ const serviceWcs = axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 - baseURL: "http://192.168.8.60:1880", + baseURL: "/wcs", // 超时 timeout: 30000 }) diff --git a/vue.config.js b/vue.config.js index edc0352..47b3d9c 100644 --- a/vue.config.js +++ b/vue.config.js @@ -43,11 +43,18 @@ module.exports = { }, '/ureport': { target: 'http://localhost:8080', - ws:false, + ws: false, changeOrigin: true, pathRewrite: { '^/ureport': '/ureport' } + }, '/wcs': { + target: 'http://192.168.8.60:1880', + ws: false, + changeOrigin: true, + pathRewrite: { + '^/wcs': '' + } }, }, disableHostCheck: true @@ -55,7 +62,7 @@ module.exports = { css: { loaderOptions: { sass: { - sassOptions: { outputStyle: "expanded" } + sassOptions: {outputStyle: "expanded"} } } }, @@ -104,39 +111,39 @@ module.exports = { .plugin('ScriptExtHtmlWebpackPlugin') .after('html') .use('script-ext-html-webpack-plugin', [{ - // `runtime` must same as runtimeChunk name. default is `runtime` + // `runtime` must same as runtimeChunk name. default is `runtime` inline: /runtime\..*\.js$/ }]) .end() config .optimization.splitChunks({ - chunks: 'all', - cacheGroups: { - libs: { - name: 'chunk-libs', - test: /[\\/]node_modules[\\/]/, - priority: 10, - chunks: 'initial' // only package third parties that are initially dependent - }, - elementUI: { - name: 'chunk-elementUI', // split elementUI into a single package - priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app - test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm - }, - commons: { - name: 'chunk-commons', - test: resolve('src/components'), // can customize your rules - minChunks: 3, // minimum common number - priority: 5, - reuseExistingChunk: true - } + chunks: 'all', + cacheGroups: { + libs: { + name: 'chunk-libs', + test: /[\\/]node_modules[\\/]/, + priority: 10, + chunks: 'initial' // only package third parties that are initially dependent + }, + elementUI: { + name: 'chunk-elementUI', // split elementUI into a single package + priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app + test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm + }, + commons: { + name: 'chunk-commons', + test: resolve('src/components'), // can customize your rules + minChunks: 3, // minimum common number + priority: 5, + reuseExistingChunk: true } - }) + } + }) config.optimization.runtimeChunk('single'), - { - from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 - to: './' //到根目录下 - } + { + from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 + to: './' //到根目录下 + } } ) }