lrf402788946 3 years ago
parent
commit
cdc7f75b7c
2 changed files with 12 additions and 8 deletions
  1. 8 1
      src/layout/layout-part/menus.vue
  2. 4 7
      src/layout/main-layout.vue

+ 8 - 1
src/layout/layout-part/menus.vue

@@ -57,7 +57,9 @@
 <script>
 export default {
   name: 'menus',
-  props: {},
+  props: {
+    allowed: { type: Boolean, default: false },
+  },
   components: {},
   data: () => ({
     defalutMenu: ['1', '2', '3'],
@@ -70,6 +72,11 @@ export default {
       return this.$route.path;
     },
     to(index) {
+      if (!this.allowed) {
+        this.$message.error('您的企业还未通过审核,请检查您的信息');
+        this.$router.push({ path: '/info/base/index' });
+        return;
+      }
       if (this.$isBindWx()) {
         this.$router.push({ path: index });
       }

+ 4 - 7
src/layout/main-layout.vue

@@ -1,13 +1,13 @@
 <template>
   <div id="main-layout">
-    <div @click="checkBind()" v-if="!toLogin()">
+    <div v-if="!toLogin()">
       <el-container style="background:#e7e8eb;">
         <el-header height="4rem" class="head">
           <heads></heads>
         </el-header>
         <el-container class="contain">
           <el-aside width="13rem" class="side">
-            <menus></menus>
+            <menus :allowed="allowed"></menus>
           </el-aside>
           <el-main class="main">
             <router-view />
@@ -41,6 +41,7 @@ export default {
   },
   data: () => ({
     dialog: false,
+    allowed: false,
   }),
   created() {},
   computed: {
@@ -58,11 +59,7 @@ export default {
     async checkBind() {
       //平台未审核/审核拒绝,只能进入基本信息去复审
       if (this.is_allowed) return;
-      if (!(await this.getInfo())) {
-        this.$message.error('您的企业还未通过审核,请检查您的信息');
-        this.$router.push({ path: '/info/base/index' });
-        return;
-      }
+      this.allowed = (await this.getInfo()) || false;
       // sessionStorage.setItem('is_allowed', true);
       if (!this.$isBindWx()) this.dialog = true;
     },