ソースを参照

修改路由配置

chenpm 2 ヶ月 前
コミット
e6440d1670
共有3 個のファイルを変更した34 個の追加34 個の削除を含む
  1. 2 2
      src/common/js/constant.js
  2. 2 2
      src/router/index.js
  3. 30 30
      vue.config.js

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

@@ -1,9 +1,9 @@
 // 系统常量
 // h5Server
-// const BASE_URI = '/h5Server'
+const BASE_URI = '/h5Server'
 // const BASE_URI = 'https://lifeline.idea-sf.com/lifelineApi' // 测试
 // const BASE_URI = 'http://2.22.195.139:8080/api' // 正式(测试)
-const BASE_URI = 'http://2.22.195.139:8781/apiForProd' // 跳转到正式
+// const BASE_URI = 'http://2.22.195.139:8781/apiForProd' // 跳转到正式
 
 // const BASE_URI = 'https://2.21.138.147:8080/api' // 正式
 

+ 2 - 2
src/router/index.js

@@ -79,8 +79,8 @@ router.beforeEach((to, from, next) => {
 //         alert("点击确认浏览测试页面");
 //         next("/login");
 //     } else {
-        next();
-//     } // 修改显示标题
+    next()
+    //     } // 修改显示标题
     console.log(to)
     document.title = to.matched[0].meta.title
 })

+ 30 - 30
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,22 +30,22 @@ module.exports = {
         // 以上的ip和端口是我们本机的;下面为需要跨域的
         proxy: {
             // 配置跨域
-            "/h5Server": {
+            '/h5Server': {
 
-                // target: `http://2.22.195.139:8080/apiForProd`,
-                target: `http://lifeline.idea-sf.com/lifelineApi`,
+                target: `http://2.22.195.139:8781/apiForProd`,
+                // target: `http://lifeline.idea-sf.com/lifelineApi`,
                 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就可以
                 }
             }
         }
@@ -56,15 +56,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({ // 插件在这里使用
@@ -75,8 +75,8 @@ module.exports = {
             //     openAnalyzer: false
             // }),
             new Webpack.ProvidePlugin({
-                $: "jquery",
-                jquery: "jquery"
+                $: 'jquery',
+                jquery: 'jquery'
             }),
             new CompressionPlugin({
                 // test: /\.(js|css)?$/i, // 哪些文件要压缩
@@ -84,9 +84,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才会压缩
             })
@@ -101,4 +101,4 @@ module.exports = {
             }
         }
     }
-};
+}