Jelajahi Sumber

登录跳转首页,页面跟随

peixh 3 tahun lalu
induk
melakukan
49d6b1284c

+ 1 - 1
front-vue/src/components/Breadcrumb/index.vue

@@ -36,7 +36,7 @@ export default {
       let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
       const first = matched[0]
       if (!this.isDashboard(first)) {
-        matched = [{ path: '/homePage/index', meta: { title: '首页' }}].concat(matched)
+        matched = [{ path: '/homePage/home', meta: { title: '首页' }}].concat(matched)
         
       }
 

+ 3 - 2
front-vue/src/layout/components/Horizontalbar/index.vue

@@ -74,8 +74,8 @@ export default {
     },
     handleClick () {
       debugger;
-      console.log(this.item.children[0].name)
-      console.log(this.item.path);
+      console.log(this.item.children[0].name,"lalaalal")
+      console.log(this.item.path,"uububuybub");
       // if(this.item.children[0].name == '/index'){
       //   EventBus.$emit('on-click-higher', {children: '', basepath: ''})
       //   this.$router.push({ path: "/" });
@@ -84,6 +84,7 @@ export default {
       //   this.$router.push({ path: "/leaderCockpit" });
       // }else{
         if (this.higher) {
+          console.log(this.higher,"jfvriuhfgvuerhf")
           EventBus.$emit('on-click-higher', {children: this.item, basepath: ''})
         } else {
           EventBus.$emit('on-click-higher', {children: this.item.children, basepath: this.resolvePath(this.item.path)})

+ 1 - 1
front-vue/src/layout/components/TagsView/index.vue

@@ -17,7 +17,7 @@
         @contextmenu.prevent.native="openMenu(tag,$event)"
       >
         {{ tag.title }}
-         <span v-if="!isAffix(tag)&& tag.path != '/homePage/index'" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
+         <span v-if="!isAffix(tag)&& tag.path != '/homePage/home'" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
       </router-link>
       <!-- <el-button class="close-button" type="danger" size="mini" icon="el-icon-close" @click="closeAllTags(selectedTag)">关闭所有</el-button> -->
     </scroll-pane>

+ 1 - 1
front-vue/src/layout/components/User/index.vue

@@ -70,7 +70,7 @@ export default {
         type: 'warning'
       }).then(() => {
         this.$store.dispatch('LogOut').then(() => {
-          location.href = '/index';
+          location.href = '/home';
         })
       })
     }

+ 8 - 8
front-vue/src/router/index.js

@@ -68,11 +68,11 @@ export const constantRoutes = [
     component: (resolve) => require(['@/views/system/company/certification'], resolve),
     hidden: true
   },
-  {
-    path: '/home',
-    component: (resolve) => require(['@/views/home'], resolve),
-    hidden: true
-  },
+  // {
+  //   path: '/home',
+  //   component: (resolve) => require(['@/views/home'], resolve),
+  //   hidden: true
+  // },
   {
     path: '/404',
     component: (resolve) => require(['@/views/error/404'], resolve),
@@ -87,11 +87,11 @@ export const constantRoutes = [
     path: '',
     component: Layout,
     hidden: true,
-    redirect: 'index',
+    redirect: 'home',
     children: [
       {
-        path: 'index',
-        component: (resolve) => require(['@/views/index'], resolve),
+        path: 'home',
+        component: (resolve) => require(['@/views/home'], resolve),
         // name: '首页',
         meta: { title: '首页', icon: '' }
       }

+ 1 - 1
front-vue/src/utils/request.js

@@ -87,7 +87,7 @@ service.interceptors.response.use(res => {
         }
       ).then(() => {
         store.dispatch('LogOut').then(() => {
-          location.href = '/index';
+          location.href = '/home';
         })
       })
     } else if (code === 500) {

+ 10 - 0
front-vue/src/views/home.vue

@@ -410,6 +410,7 @@ import { listNotice } from '@/api/system/notice'
 import { amtformat } from "@/utils/amtCommon"
 import  EchartPie  from '@/components/Echart/pie/index'
 import  EchartBar  from '@/components/Echart/bar/index'
+import { EventBus } from '@/util/event-bus.js'
 export default {
   components: {
     EchartPie,
@@ -528,6 +529,15 @@ export default {
         }
     },
     created: function () {
+        var children = [];
+        this.$store.state.permission.routes.map((item) => {
+            if (this.$route.matched[0] && item.alwaysShow && this.$route.matched[0].path == item.path) {
+            children = item.children
+            }
+        });
+        if(children && children.length != 0){
+            EventBus.$emit('on-click-higher', {children: children, basepath: this.$route.matched[0].path})
+        }
         //查询企业类型
         getOwnCompany().then((response) => {
             this.company = response.data;

+ 10 - 4
front-vue/src/views/login.vue

@@ -239,12 +239,13 @@ export default {
                           } else if (data.code == "1") {
                             // 认证通过
                             if (data.loginUser.sysUser.companyStatus == "00") {
-                              /* if(this.redirect == '/index'){
+                                console.log(this.redirect,"AAAAA")
+                              if(this.redirect == '/home'){
                                   this.$router.push({ path: "/homePage"+this.redirect || "/" });
                               }else{
                                   this.$router.push({ path: this.redirect || "/" });
-                              } */
-                              this.$router.push({ path: this.redirect || "/" });
+                              }
+                            //   this.$router.push({ path: this.redirect || "/" });
                             // 认证未通过
                             } else {
                               console.log("未认证通过!")
@@ -314,7 +315,12 @@ export default {
           if (response.code == "200") {
             // 认证通过
             if (response.data.sysUser.companyStatus == "00") {
-              this.$router.push({ path: this.redirect || "/" });
+                if(this.redirect == '/home'){
+                    this.$router.push({ path: "/homePage"+this.redirect || "/" });
+                }else{
+                    this.$router.push({ path: this.redirect || "/" });
+                }
+            //   this.$router.push({ path: this.redirect || "/" });
             // 认证未通过
             } else {
               console.log("未认证通过!")