Explorar el Código

Merge branch 'master' of http://git.cc-lotus.info/service-platform/mobile-official into master

wxy hace 4 años
padre
commit
f0c9ceff6e
Se han modificado 3 ficheros con 11 adiciones y 18 borrados
  1. 3 0
      src/layout/common/footInfo.vue
  2. 0 14
      src/router/before.js
  3. 8 4
      src/router/index.js

+ 3 - 0
src/layout/common/footInfo.vue

@@ -3,6 +3,9 @@
     <el-row>
       <el-col :span="24" class="footInfo">
         <van-tabbar route>
+          <van-tabbar-item to="/">
+            <p class="text">首页</p>
+          </van-tabbar-item>
           <van-tabbar-item to="/live/index">
             <p class="text">直播大厅</p>
           </van-tabbar-item>

+ 0 - 14
src/router/before.js

@@ -1,14 +0,0 @@
-import store from '@/store/index';
-
-const checkLogin = (router, func) => {
-  router.beforeEach(async (to, form, next) => {
-    if (to.name == 'user_index') {
-      let res = await store.dispatch('login/toGetUser', func ? func : null);
-      next();
-    } else {
-      // console.log('2');
-      next();
-    }
-  });
-};
-export default checkLogin;

+ 8 - 4
src/router/index.js

@@ -1,16 +1,22 @@
 import Vue from 'vue';
 import VueRouter from 'vue-router';
 import store from '@/store/index';
-import checkLogin from './before';
 
 Vue.use(VueRouter);
 
 const routes = [
+  // 首页
+  {
+    path: '/',
+    name: 'index',
+    meta: { title: '首页', isleftarrow: false },
+    component: () => import('../views/index.vue'),
+  },
   // 直播大厅
   {
     path: '/live/index',
     name: 'live_index',
-    meta: { title: '直播大厅', isleftarrow: true },
+    meta: { title: '直播大厅', isleftarrow: false },
     component: () => import('../views/live/index.vue'),
   },
   {
@@ -120,8 +126,6 @@ router.beforeEach(async (to, form, next) => {
     next();
   }
 });
-
-// checkLogin(router);
 const originalPush = VueRouter.prototype.push;
 VueRouter.prototype.push = function push(location, onResolve, onReject) {
   if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject);