陈鹏铭 2 mesi fa
parent
commit
e97798ea67
2 ha cambiato i file con 31 aggiunte e 31 eliminazioni
  1. 2 2
      src/common/js/constant.js
  2. 29 29
      vue.config.js

+ 2 - 2
src/common/js/constant.js

@@ -1,7 +1,7 @@
 // 系统常量
 // h5Server
-// const BASE_URI = '/h5Server'
-const BASE_URI = 'http://lifeline.idea-sf.com/lifelineApi'
+const BASE_URI = '/h5Server'
+// const BASE_URI = 'http://lifeline.idea-sf.com/lifelineApi'
 // const BASE_URI = 'http://2.22.195.139:8080/api'
 
 

+ 29 - 29
vue.config.js

@@ -1,25 +1,25 @@
-"use strict";
-const path = require("path");
+'use strict'
+const path = require('path')
 
 function resolve(dir) {
-    return path.join(__dirname, dir);
+    return path.join(__dirname, dir)
 }
 
-const name = "微纳园"; // page title
+const name = '微纳园' // page title
 
-const ip = "0.0.0.0"; // dev port
-const port = 9528; // dev port
+const ip = '0.0.0.0' // dev port
+const port = 9525 // dev port
 
-const Webpack = require("webpack");
+const Webpack = require('webpack')
 // const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
-const CompressionPlugin = require("compression-webpack-plugin");
+const CompressionPlugin = require('compression-webpack-plugin')
 
 module.exports = {
     // publicPath: '/mnpH5/', // 代理模式使用
-    publicPath: "/lifelineH5/", // tomcat模式使用
-    outputDir: "dist",
-    assetsDir: "assets",
-    lintOnSave: process.env.NODE_ENV === "development",
+    publicPath: '/lifelineH5/', // tomcat模式使用
+    outputDir: 'dist',
+    assetsDir: 'assets',
+    lintOnSave: process.env.NODE_ENV === 'development',
     productionSourceMap: false,
     devServer: {
         open: true,
@@ -30,21 +30,21 @@ module.exports = {
         // 以上的ip和端口是我们本机的;下面为需要跨域的
         proxy: {
             // 配置跨域
-            "/h5Server": {
+            '/h5Server': {
                 // target: `http://localhost:9001`,
-                target: `http://lifeline.idea-sf.com/lifelineApi`,
+                target: `http://2.22.195.139:8781/apiForProd`,
                 ws: true,
                 changOrigin: true, // 允许跨域
                 pathRewrite: {
-                    "^/h5Server": "" // 请求的时候使用这个server就可以
+                    '^/h5Server': '' // 请求的时候使用这个server就可以
                 }
             },
-            "/server": {
+            '/server': {
                 target: process.env.VUE_APP_API_URL,
                 ws: true,
                 changOrigin: true, // 允许跨域
                 pathRewrite: {
-                    "^/server": "" // 请求的时候使用这个server就可以
+                    '^/server': '' // 请求的时候使用这个server就可以
                 }
             }
         }
@@ -55,15 +55,15 @@ module.exports = {
         name: name,
         resolve: {
             alias: {
-                "@": resolve("src")
+                '@': resolve('src')
             }
         },
         externals: {
-            vue: "Vue",
-            "vue-router": "VueRouter",
-            axios: "axios",
-            vant: "vant",
-            moment: "moment"
+            vue: 'Vue',
+            'vue-router': 'VueRouter',
+            axios: 'axios',
+            vant: 'vant',
+            moment: 'moment'
         },
         plugins: [
             // new BundleAnalyzerPlugin({ // 插件在这里使用
@@ -74,8 +74,8 @@ module.exports = {
             //     openAnalyzer: false
             // }),
             new Webpack.ProvidePlugin({
-                $: "jquery",
-                jquery: "jquery"
+                $: 'jquery',
+                jquery: 'jquery'
             }),
             new CompressionPlugin({
                 // test: /\.(js|css)?$/i, // 哪些文件要压缩
@@ -83,9 +83,9 @@ module.exports = {
                 // algorithm: 'gzip', // 使用gzip压缩
                 // minRatio: 1, // 压缩率小于1才会压缩
                 // deleteOriginalAssets: true // 删除未压缩的文件,谨慎设置,如果希望提供非gzip的资源,可不设置或者设置为false
-                filename: "[path].gz[query]", // 压缩后的文件名(保持原文件名,后缀加.gz)
-                algorithm: "gzip", // 使用gzip压缩
-                test: new RegExp("\\.(" + ["js", "css"].join("|") + ")$"), // 匹配文件名
+                filename: '[path].gz[query]', // 压缩后的文件名(保持原文件名,后缀加.gz)
+                algorithm: 'gzip', // 使用gzip压缩
+                test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'), // 匹配文件名
                 threshold: 10240, // 对超过10k的数据压缩
                 minRatio: 0.8 // 压缩率小于0.8才会压缩
             })
@@ -100,4 +100,4 @@ module.exports = {
             }
         }
     }
-};
+}