浏览代码

环境切换

wucl 1 年之前
父节点
当前提交
522cda9c21
共有 2 个文件被更改,包括 11 次插入11 次删除
  1. 2 2
      src/router/index.js
  2. 9 9
      vue.config.js

+ 2 - 2
src/router/index.js

@@ -85,8 +85,8 @@ requireAll(files);
 
 const createRouter = () => new VueRouter({
   mode: 'hash', // require service support
-  // base: '/admin',
-  base: '/admin-test',
+  base: '/admin',
+  //base: '/admin-test',
   scrollBehavior: () => ({ y: 0 }),
   routes: routes
 });

+ 9 - 9
vue.config.js

@@ -28,7 +28,7 @@ module.exports = {
    */
   // publicPath: '/',
   publicPath: process.env.NODE_ENV === 'production'
-    ? '/admin-test' // [通过 ip:port/admin 访问,并注意配置route 的base] ??history模式下打包有问题, 只能使用'/' 不能是'./'否则静态资源会报错,要直接点访问只能使用hash模式('./')?? https://cli.vuejs.org/zh/config/#publicpath
+    ? '/admin' // [通过 ip:port/admin 访问,并注意配置route 的base] ??history模式下打包有问题, 只能使用'/' 不能是'./'否则静态资源会报错,要直接点访问只能使用hash模式('./')?? https://cli.vuejs.org/zh/config/#publicpath
     : '/',
   outputDir: 'dist',
   assetsDir: 'static',
@@ -42,18 +42,18 @@ module.exports = {
       errors: true
     },
     proxy: {
-      // '/api': {
-      //   // prod
-      //   target: 'http://127.0.0.1:8088',
-      //   changeOrigin: true,
-      //   pathRewrite: {}
-      // },
       '/api': {
-        // test (docker)
-        target: 'http://127.0.0.1:8089',
+        // prod
+        target: 'http://127.0.0.1:8088',
         changeOrigin: true,
         pathRewrite: {}
       },
+      // '/api': {
+      //   // test (docker)
+      //   target: 'http://127.0.0.1:8089',
+      //   changeOrigin: true,
+      //   pathRewrite: {}
+      // },
       '/dfs': {
         target: 'http://127.0.0.1:80',
         changeOrigin: true,