Ver código fonte

Merge branch 'master' of http://git.cc-lotus.info/smart-jobs/web-center

guhongwei 5 anos atrás
pai
commit
5cc954e08e
5 arquivos alterados com 10 adições e 5 exclusões
  1. 2 0
      .env
  2. 3 1
      src/router/index.js
  3. 3 3
      src/views/index.vue
  4. 1 0
      src/views/newsList.vue
  5. 1 1
      vue.config.js

+ 2 - 0
.env

@@ -0,0 +1,2 @@
+VUE_APP_AXIOS_BASE_URL = ''
+VUE_APP_ROUTER="/www"

+ 3 - 1
src/router/index.js

@@ -4,6 +4,8 @@ import Router from 'vue-router';
 Vue.use(Router);
 
 export default new Router({
+  mode: 'history',
+  base: process.env.NODE_ENV === 'development' ? '' : process.env.VUE_APP_ROUTER,
   routes: [
     {
       path: '/',
@@ -31,7 +33,7 @@ export default new Router({
       component: () => import('../views/memberDetail.vue'),
     },
     {
-      path: '/newsList',
+      path: '/newsList/:type/:id',
       name: 'newsList',
       component: () => import('../views/newsList.vue'),
     },

+ 3 - 3
src/views/index.vue

@@ -128,7 +128,7 @@ export default {
           if (col.type === 'content') {
             col.path = `/info/detail?id=${col.content_id}`;
           } else if (col.type !== 'url') {
-            col.path = `/info/list/${col.id}`;
+            col.path = `/newsList/${col.id}`;
           }
         }
         return columns;
@@ -173,10 +173,10 @@ export default {
         let columns = result.data;
         for (const col of columns) {
           if (col.type === `bugList`) {
-            col.path = `/info/list/${col.content_id}`;
+            col.path = `/newsList/${col.content_id}`;
             col.children = await this.completeColumn(col);
           } else if (col.type === `column`) {
-            col.path = `/info/list/${col.id}`;
+            col.path = `/newsList/${col.id}`;
             col.children = await this.completeColumn(col);
           } else if (col.type === `content`) {
             col.path = `/info/detail?id=${col.content_id}`;

+ 1 - 0
src/views/newsList.vue

@@ -114,6 +114,7 @@ export default {
       },
     ],
     menu: [],
+    sideMenu: [],
   }),
   created() {
     this.loadMenu(); //获取菜单信息

+ 1 - 1
vue.config.js

@@ -1,7 +1,7 @@
 const path = require('path');
 const publics = path.resolve(__dirname, '../web-common');
 module.exports = {
-  publicPath: '/',
+  publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROUTER,
   // 双页面配置
   // pages: {
   //   index: 'src/views/index/main.js',