lsc 2 years ago
parent
commit
b780b98183
3 changed files with 14 additions and 12 deletions
  1. 3 3
      src/store/modules/user.js
  2. 1 0
      src/views/home/index.vue
  3. 10 9
      src/views/layouts/index.vue

+ 3 - 3
src/store/modules/user.js

@@ -75,9 +75,9 @@ const actions = {
           resolve(_user.userid)
         })
         .catch(error => {
-          // var _user = { userid: '5943e08c-b7d4-11ed-8d51-005056b86db5' }
-          // setToken(_user.userid)
-          // resolve(_user.userid)
+          var _user = { userid: '5943e08c-b7d4-11ed-8d51-005056b86db5' }
+          setToken(_user.userid)
+          resolve(_user.userid)
           reject(error)
         })
     })

+ 1 - 0
src/views/home/index.vue

@@ -125,6 +125,7 @@ export default {
                   message: '退出成功',
                   type: 'success'
                 })
+                this.$store.dispatch('user/logout')
                 window.location.reload()
                 done()
               })

+ 10 - 9
src/views/layouts/index.vue

@@ -6,7 +6,7 @@
       </keep-alive>
       <router-view v-else></router-view>
     </div>
-    <div class="layout-footer">
+    <div class="layout-footer" v-if="false">
       <TabBar :data="tabbars" @change="handleChange" />
     </div>
   </div>
@@ -19,13 +19,13 @@ export default {
   data() {
     return {
       tabbars: [
-        // {
-        //   title: '学习中心',
-        //   to: {
-        //     path: '/home'
-        //   },
-        //   icon: 'home-o'
-        // }
+        {
+          title: '学习中心',
+          to: {
+            path: '/home'
+          },
+          icon: 'home-o'
+        }
         // {
         //   title: '关于我',
         //   to: {
@@ -50,7 +50,8 @@ export default {
 .app-container {
   height: 100vh;
   .layout-content {
-    height: calc(100% - 50px);
+    // height: calc(100% - 50px);
+    height: calc(100%);
   }
   .layout-footer {
     display: block;