Browse Source

切换角色重新获取消息

gzb
guozhongbo 9 months ago
parent
commit
f3b7d72b0a
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      src/views/layout.vue

+ 11
- 1
src/views/layout.vue View File

@@ -221,11 +221,21 @@ export default {
221 221
       userInfo: {}
222 222
     };
223 223
   },
224
+  watch: {
225
+    $route: {
226
+      handler() {
227
+        if (this.$route.path.includes("home") && this.powerParams.rtype > 1) {
228
+          this.init();
229
+        }
230
+      },
231
+      immediate: true,
232
+      deep: true
233
+    }
234
+  },
224 235
   created() {
225 236
     this.userInfo = JSON.parse(
226 237
       localStorage.getItem("xh_control_userInfo")
227 238
     ).content;
228
-    this.init();
229 239
   },
230 240
   computed: {
231 241
     // 所属名称

Loading…
Cancel
Save