guhongwei %!s(int64=4) %!d(string=hai) anos
pai
achega
fc35310cdf
Modificáronse 1 ficheiros con 9 adicións e 3 borrados
  1. 9 3
      src/views/live/index.vue

+ 9 - 3
src/views/live/index.vue

@@ -71,9 +71,6 @@ export default {
     await this.searchList({ status: '0' });
     await this.searchList({ status: '1' });
     await this.searchList({ status: '2' });
-    if (this.token) {
-      this.sesstoken();
-    }
   },
   methods: {
     ...mapMutations(['setUser']),
@@ -115,6 +112,15 @@ export default {
       return this.$route.query.token;
     },
   },
+  watch: {
+    token: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        this.sesstoken();
+      },
+    },
+  },
   mounted() {
     this.title = this.$route.meta.title;
     this.isleftarrow = this.$route.meta.isleftarrow;