Browse Source

有企业信息时 第一次访问页面 跳转企业列表

hy 7 years ago
parent
commit
3b6a256896
1 changed files with 13 additions and 0 deletions
  1. 13 0
      frontend/saas-portal-web/src/components/conenter/home.vue

+ 13 - 0
frontend/saas-portal-web/src/components/conenter/home.vue

@@ -276,6 +276,19 @@
           session.account = account
           Session.set(session);
           this.account = Session.getAccount();
+          //有企业信息时 第一次访问页面 跳转企业列表
+          if(account.companies.length>0){
+            //监听访问首页的次数
+            if(!localStorage.VisitCount){
+              localStorage.VisitCount = '1'
+            }else{
+              localStorage.VisitCount = (Number(localStorage.VisitCount) + 1 ) + ''
+            }
+            if(localStorage.VisitCount=='1'){
+              const me = this || _this;
+              me.$router.push({path: '/enterprise'})
+            }
+          }
         }
       })
     },