ruifeng_liu 3 years ago
parent
commit
b360065a08
1 changed files with 9 additions and 3 deletions
  1. 9 3
      src/layout/main-layout.vue

+ 9 - 3
src/layout/main-layout.vue

@@ -44,15 +44,21 @@ export default {
     allowed: false,
   }),
   created() {},
-  mounted() {
-    this.checkBind();
-  },
   computed: {
     ...mapState(['user']),
     // is_allowed() {
     //   return JSON.parse(sessionStorage.getItem('is_allowed'));
     // },
   },
+  watch: {
+    user: {
+      deep: true,
+      immediate: true,
+      handler(val) {
+        if (val && val.corpid) this.checkBind();
+      },
+    },
+  },
   methods: {
     ...mapActions(['corpOperation']),
     async getInfo() {