zhongshujie
2025-03-31 21bf629ca55c2f2f4ca21486ff0ce609f6343365
src/router/index.js
@@ -2,22 +2,22 @@
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);
const routes = [{
const routes = [
  {
    path: "/",
    name: "HomeLayout",
    component: HomeLayout,
    redirect: {
      name: "home"
      name: "honor",
    },
    children: [
      // 在主框架内
@@ -27,9 +27,18 @@
        meta: {
          name: "首页",
          authentication: false, // 是否需要登录验证
          keepAlive: false // 是否需要缓存
          keepAlive: false, // 是否需要缓存
        },
        component: Home
        component: Home,
      },
      {
        path: "/honor",
        name: "honor",
        meta: {
          name: "荣誉奖项",
        },
        component: Honor,
      },
      // {
@@ -41,9 +50,7 @@
      //   },
      //   component: () => import("@/views/login/login")
      // },
    ]
    ],
  },
  // 不在主框架内
  // {
@@ -51,11 +58,10 @@
  //   name: "pdf",
  //   component: () => import("@/components/play/pdf")
  // },
];
const router = new VueRouter({
  routes
  routes,
});
export default router;
export default router;