| | |
| | | openMenu(item = {}) { |
| | | this.$store.dispatch('GetMenu', item.id).then(data => { |
| | | if (data.length !== 0) { |
| | | this.$router.$avueRouter.formatRoutes(data, true); |
| | | const redirect = decodeURIComponent(to.query.redirect || ''); |
| | | this.$router.$avueRouter.formatRoutes(data, true) |
| | | |
| | | // 获取url里面的redirect |
| | | const redirect = decodeURIComponent(this.$route.query.redirect || ''); |
| | | if (redirect){ |
| | | console.log('redirect',redirect); |
| | | this.$router.push({ path: redirect}) |
| | | const [path, queryString] = redirect.split('?'); |
| | | const query = queryString ? Object.fromEntries(new URLSearchParams(queryString)) : {}; |
| | | this.$router.push({ path,query}) |
| | | } |
| | | } |
| | | //当点击顶部菜单后默认打开第一个菜单 |