MrShi
7 小时以前 bff05c941230c57f0a1ed8d0e3c4f9c7b2b8af13
admin/src/main.js
@@ -55,7 +55,7 @@
    }
  },
  methods: {
    ...mapMutations(['switchCollapseMenu', 'setHomePage', 'setTopMenuCurrent', 'setTopMenuCurrent','cleartagsview']),
    ...mapMutations(['switchCollapseMenu', 'setCurrentIndex', 'setHomePage', 'setTopMenuCurrent', 'setTopMenuCurrent','cleartagsview']),
    // 初始化本地配置
    initLocalConfig () {
      // 菜单状态配置
@@ -95,7 +95,14 @@
              tlist.push(...item.children)
            }
          })
          if (this.$route.query && this.$route.query.menuparams) {
            let menu = topList.filter(item => item.params === this.$route.query.menuparams)
            this.setTopMenuCurrent(menu[0])
            this.setCurrentIndex(topList.findIndex(obj => obj.params === this.$route.query.menuparams))
          } else {
          this.setTopMenuCurrent(topCurrent)
            this.setCurrentIndex(0)
          }
          // console.log(topList)
          // var menus = []
          // topList.forEach(item => {
@@ -120,7 +127,9 @@
            redirect: this.homePage.url
          })
          // 路由加载完成后,如果访问的是/,跳转至动态识别的首页
          if (this.$route.path === '/') {
          if (this.$route.query && this.$route.query.menuparams) {
            this.$router.push(topList.filter(item => item.params === this.$route.query.menuparams)[0].homeUrl)
          } else if (this.$route.path === '/') {
            this.$router.push(this.homePage.url)
          }
        })