| | |
| | | const originalPush = VueRouter.prototype.push; |
| | | |
| | | VueRouter.prototype.push = function push(location) { |
| | | return originalPush.call(this, location).catch((err) => err); |
| | | const nowPage = sessionStorage.getItem('routerName') |
| | | const page = { |
| | | path: nowPage |
| | | } |
| | | if (page === location || location === '/') { |
| | | return originalPush.call(this, page).catch((err) => err); |
| | | } else { |
| | | return originalPush.call(this, location).catch((err) => err); |
| | | } |
| | | }; |
| | | |
| | | // 群组管理 |
| | |
| | | }); |
| | | //路由守卫 |
| | | router.beforeEach((to, from, next) => { |
| | | sessionStorage.setItem('routerName', to.path) |
| | | next(); |
| | | if (to.matched.some((auth) => auth.meta.requireAuth)) { |
| | | // 获取token |