Parcourir la source

Merge branch 'master' of https://git.cocorobo.cn/jack/EvenManage

zengyicheng il y a 2 ans
Parent
commit
791f1affdf
1 fichiers modifiés avec 22 ajouts et 32 suppressions
  1. 22 32
      src/App.vue

+ 22 - 32
src/App.vue

@@ -2,11 +2,7 @@
   <div id="app" :class="{}">
     <div class="app_head">
       <div class="logo" @click="goTo('/course')"></div>
-      <span
-        style="margin-left: 10px; color: #fff; font-size: 16px"
-        @click="goTo('/course')"
-        >广东省案例征集</span
-      >
+      <span style="margin-left: 10px; color: #fff; font-size: 16px" @click="goTo('/course')">广东省案例征集</span>
       <div class="user_head" v-if="this.$store.state.isLogin">
         <!-- <div class="noticeBox">
           <i class="noticeI" @click="goTo('/works')"></i>
@@ -15,7 +11,7 @@
           }}</span>
         </div> -->
         <span class="user_name">{{
-          this.$store.state.userInfo ? this.$store.state.userInfo.name : "用户"
+            this.$store.state.userInfo ? this.$store.state.userInfo.name : "用户"
         }}</span>
         <div @click="exit">
           <i class="exitI"></i>
@@ -23,37 +19,24 @@
         </div>
       </div>
     </div>
-    <div
-      style="width: 100%; height: 100%"
-      :class="{
-        ggheight: true,
-      }"
-    >
+    <div style="width: 100%; height: 100%" :class="{
+      ggheight: true,
+    }">
       <!-- main 内容 -->
       <keep-alive v-if="$route.meta.keepAlive">
         <!-- 这里是会被缓存的视图组件 -->
-        <router-view
-          v-if="$route.meta.keepAlive"
-          :class="{ pb_body: isShowNav }"
-        />
+        <router-view v-if="$route.meta.keepAlive" :class="{ pb_body: isShowNav }" />
       </keep-alive>
       <!-- 这里是不被缓存的视图组件 -->
-      <router-view
-        v-if="!$route.meta.keepAlive"
-        :class="{ pb_body: isShowNav }"
-      />
+      <router-view v-if="!$route.meta.keepAlive" :class="{ pb_body: isShowNav }" />
 
       <!-- 底部导航 -->
-      <footer-nav
-        v-if="
-          isShowNav &&
-          ($store.state.userInfo.type == 2 ||
-            $store.state.userInfo.type == 3 ||
-            $store.state.userInfo.type == 4)
-        "
-        :nav="nav"
-        :luyou="this.$store.state.luyou"
-      ></footer-nav>
+      <footer-nav v-if="
+        isShowNav &&
+        ($store.state.userInfo.type == 2 ||
+          $store.state.userInfo.type == 3 ||
+          $store.state.userInfo.type == 4)
+      " :nav="nav" :luyou="this.$store.state.luyou"></footer-nav>
     </div>
   </div>
 </template>
@@ -95,6 +78,11 @@ export default {
         this.$store.commit("update", ["isLogin", true]);
         // var info = JSON.parse(window.sessionStorage.getItem("userInfo"));
         this.$store.commit("update", ["userInfo", userInfo]);
+        if (userInfo.type == '1') {
+          this.$router.push("/eventCenter?steps=" + "2");
+        } else if (userInfo.type == '2' || userInfo.type == '3' || userInfo.type == '4' || userInfo.type == '5' || userInfo.type == '6') {
+          this.$router.push("/anliList");
+        }
         this.routerP();
       } else {
         this.$store.commit("update", ["isLogin", false]);
@@ -104,7 +92,9 @@ export default {
         });
         setTimeout(() => {
           loading.close();
-          this.$router.push("/login");
+          if (this.$route.path != '/login') {
+            this.$router.push("/login");
+          }
         }, 2000);
       }
     },
@@ -113,7 +103,7 @@ export default {
       const { userInfo } = this.$store.state;
       let router_path = this.$route.path;
       console.log(router_path);
-      if (router_path != "/login" && !userInfo.type) {
+      if (!userInfo.type) {
         this.isLogin();
         return;
       }