guhongwei 4 years ago
parent
commit
64a85d4fed
1 changed files with 10 additions and 10 deletions
  1. 10 10
      src/views/index.vue

+ 10 - 10
src/views/index.vue

@@ -57,7 +57,7 @@ export default {
     };
   },
   created() {
-    if (!this.$route.query.token) {
+    if (this.$route.query.token) {
       this.searchToken();
       this.search();
     }
@@ -102,15 +102,15 @@ export default {
     },
     searchToken() {
       let token = this.$route.query.token;
-      // let user = jwt.decode(token);
-      let user = {
-        mobile: '1',
-        name: '班主任6',
-        status: '0',
-        type: '1',
-        uid: '5f2b632f4f8ae07098a7ab63',
-        userid: '5f2b632f4f8ae07098a7ab63',
-      };
+      let user = jwt.decode(token);
+      // let user = {
+      //   mobile: '1',
+      //   name: '班主任6',
+      //   status: '0',
+      //   type: '1',
+      //   uid: '5f2b632f4f8ae07098a7ab63',
+      //   userid: '5f2b632f4f8ae07098a7ab63',
+      // };
       this.$set(this, 'userinfo', user);
       sessionStorage.setItem('user', JSON.stringify(user));
     },