Selaa lähdekoodia

修复面包屑

ming 3 vuotta sitten
vanhempi
commit
2ddf4df05f
2 muutettua tiedostoa jossa 7 lisäystä ja 17 poistoa
  1. 1 6
      src/layout/vab-tabs/index.vue
  2. 6 11
      src/vab/plugins/permissions.js

+ 1 - 6
src/layout/vab-tabs/index.vue

@@ -20,7 +20,7 @@
         <el-breadcrumb-item
           v-for="(item, ind) in breadListLast"
           :key="ind"
-          :to="item.path"
+         
         >
           {{ item.title }}
         </el-breadcrumb-item>
@@ -88,17 +88,12 @@ export default {
   methods: {
     loadChange() {
       this.breadListLast = []
-      //  console.log('this.$route')
-      // console.log(this.$route)
 
       this.$route.matched.map((val) => {
-        // console.log('val')
-        // console.log(val)
         this.breadListLast.push({
           path:val.path,
           title:val.meta.title
         })
-
       })
     },
 

+ 6 - 11
src/vab/plugins/permissions.js

@@ -32,7 +32,7 @@ router.beforeEach(async(to, from, next) => {
                 // console.log('to.matched')
                 // console.log(to.matched)
                 if (to.matched.length === 0) {
-                    alert('没有匹配')
+                    // alert('没有匹配')
                     next('/404') // 判断此跳转路由的来源路由是否存在,存在的情况跳转到来源路由,否则跳转到404页面
                 }
                 next()
@@ -53,20 +53,15 @@ router.beforeEach(async(to, from, next) => {
                     }
 
                     accessRoutes.forEach((item) => {
-                            console.log('item')
-                            console.log(item)
-                            router.addRoute(item)
-                        })
-                        // alert(accessRoutes[accessRoutes.length - 1].redirect)
-                        // accessRoutes[accessRoutes.length - 1].redirect = "systemManage/userManage"
-                        // alert(accessRoutes[accessRoutes.length - 1].redirect)
+
+                        router.addRoute(item)
+                    })
+
                     if (accessRoutes[1].path != '/') {
-                        // alert(2)
                         next(accessRoutes[1].path)
 
                     } else {
-                        console.log('accessRoutes')
-                        console.log(accessRoutes)
+
 
                         next({...to, replace: true })