杨磊
2025-03-31 8209ece89c9ee3ba78969433b60b4d20af6b9421
src/router/index.js
@@ -2,12 +2,11 @@
import VueRouter from "vue-router";
import HomeLayout from "@/layout";
import Home from "@/views/home";
import Honor from "@/views/honors";
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err);
  return originalPush.call(this, location).catch((err) => err);
};
Vue.use(VueRouter);
@@ -17,7 +16,7 @@
    name: "HomeLayout",
    component: HomeLayout,
    redirect: {
      name: "home"
      name: "honor",
    },
    children: [
      // 在主框架内
@@ -25,13 +24,36 @@
        path: "/chronology",
        name: "chronology",
        meta: {
          name: "首页",
          name: "年谱",
          authentication: false, // 是否需要登录验证
          keepAlive: false // 是否需要缓存
          keepAlive: false, // 是否需要缓存
        },
        component: ()=> import("@/views/chronology/index.vue")
        component: () => import("@/views/chronology/index.vue")
      },
      {
        path: "/honor",
        name: "honor",
        meta: {
          name: "荣誉奖项",
        },
        component: Honor,
      },
      {
        path: "/achievements",
        name: "achievements",
        meta: {
          name: "学术成果",
        },
        component: () => import("@/views/achievements/index.vue"),
      },
      {
        path: "/directory",
        name: "directory",
        meta: {
          name: "学生名录",
        },
        component: () => import("@/views/directory/index.vue"),
      },
      // {
      //   path: "/login",
      //   name: "login",
@@ -44,7 +66,7 @@
    ]
  },
  // 不在主框架内
  {
@@ -62,11 +84,10 @@
  //   name: "pdf",
  //   component: () => import("@/components/play/pdf")
  // },
];
const router = new VueRouter({
  routes
  routes,
});
export default router;