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