Browse Source

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

wxy 4 years ago
parent
commit
1e94dca86f
1 changed files with 14 additions and 0 deletions
  1. 14 0
      src/views/live/index.vue

+ 14 - 0
src/views/live/index.vue

@@ -33,6 +33,7 @@ import footInfo from '@/layout/common/footInfo.vue';
 import liveList from './parts/liveList.vue';
 import liveList from './parts/liveList.vue';
 const { mapActions: dock } = createNamespacedHelpers('dock');
 const { mapActions: dock } = createNamespacedHelpers('dock');
 const { mapActions: place } = createNamespacedHelpers('place');
 const { mapActions: place } = createNamespacedHelpers('place');
+const jwt = require('jsonwebtoken');
 export default {
 export default {
   name: 'index',
   name: 'index',
   props: {},
   props: {},
@@ -70,8 +71,12 @@ export default {
     await this.searchList({ status: '0' });
     await this.searchList({ status: '0' });
     await this.searchList({ status: '1' });
     await this.searchList({ status: '1' });
     await this.searchList({ status: '2' });
     await this.searchList({ status: '2' });
+    if (this.token) {
+      this.sesstoken();
+    }
   },
   },
   methods: {
   methods: {
+    ...mapMutations(['setUser']),
     ...dock({ dockQuery: 'query' }),
     ...dock({ dockQuery: 'query' }),
     ...place({ palcequery: 'query', transactiondtetle: 'delete' }),
     ...place({ palcequery: 'query', transactiondtetle: 'delete' }),
     async searchList({ skip = 0, limit = 10, status, ...info } = {}) {
     async searchList({ skip = 0, limit = 10, status, ...info } = {}) {
@@ -97,9 +102,18 @@ export default {
         this.$set(this, `place`, arr.data);
         this.$set(this, `place`, arr.data);
       }
       }
     },
     },
+    sesstoken() {
+      sessionStorage.setItem('token', this.token);
+      let user = jwt.decode(this.token);
+      console.log(user);
+      this.setUser(user);
+    },
   },
   },
   computed: {
   computed: {
     ...mapState(['user']),
     ...mapState(['user']),
+    token() {
+      return this.$route.query.token;
+    },
   },
   },
   mounted() {
   mounted() {
     this.title = this.$route.meta.title;
     this.title = this.$route.meta.title;