管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-02-10 4745b682956116fa09d812c59b485395f45c2e87
src/router/index.js
@@ -54,7 +54,15 @@
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);
  }
};
// 群组管理
@@ -472,6 +480,7 @@
});
//路由守卫
router.beforeEach((to, from, next) => {
  sessionStorage.setItem('routerName', to.path)
  next();
  if (to.matched.some((auth) => auth.meta.requireAuth)) {
    // 获取token