From 375513370cc01fcd976987d07797249600b0bb3e Mon Sep 17 00:00:00 2001
From: 杨磊 <505174330@qq.com>
Date: 星期四, 07 八月 2025 17:15:09 +0800
Subject: [PATCH] 'first'

---
 src/router/index.js |  104 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 104 insertions(+), 0 deletions(-)

diff --git a/src/router/index.js b/src/router/index.js
new file mode 100644
index 0000000..b82510c
--- /dev/null
+++ b/src/router/index.js
@@ -0,0 +1,104 @@
+import Vue from "vue";
+import VueRouter from "vue-router";
+import HomeLayout from "@/layout";
+import Home from "@/views/home";
+import Search from "@/views/home/search";
+import Detail from "@/views/home/detail";
+import baseLayout from "@/layout/base";
+const originalPush = VueRouter.prototype.push
+VueRouter.prototype.push = function push(location) {
+  return originalPush.call(this, location).catch(err => err)
+}
+
+Vue.use(VueRouter);
+
+const routes = [{
+    path: "/",
+    name: "HomeLayout",
+    component: HomeLayout,
+    redirect: {
+      name: "home"
+    },
+    children: [
+      // 鍦ㄤ富妗嗘灦鍐�
+      {
+        path: "home",
+        name: "home",
+        meta: {
+          name: "棣栭〉",
+          authentication: false, // 鏄惁闇�瑕佺櫥褰曢獙璇�
+          keepAlive: false, // 鏄惁闇�瑕佺紦瀛�
+        },
+        component: baseLayout,
+        redirect: {
+          name: "index"
+        },
+        children: [{
+            path: "index",
+            name: "index",
+            meta: {
+              name: "棣栭〉",
+              authentication: false, // 鏄惁闇�瑕佺櫥褰曢獙璇�
+              keepAlive: false, // 鏄惁闇�瑕佺紦瀛�
+            },
+            component: Home,
+          },
+          {
+            path: "search",
+            name: "search",
+            meta: {
+              name: "棣栭〉鎼滅储",
+              authentication: false, // 鏄惁闇�瑕佺櫥褰曢獙璇�
+              keepAlive: true, // 鏄惁闇�瑕佺紦瀛�
+            },
+            component: Search,
+          },
+          {
+            path: "detail",
+            name: "detail",
+            meta: {
+              name: "璇︽儏",
+              // authentication: false, // 鏄惁闇�瑕佺櫥褰曢獙璇�
+              // keepAlive: true, // 鏄惁闇�瑕佺紦瀛�
+            },
+            component: Detail,
+          },
+        ],
+      },
+      {
+        path: "/login",
+        name: "login",
+        meta: {
+          name: "鐧诲綍",
+          authentication: false,
+        },
+        component: () => import("@/views/login/login"),
+      },
+      {
+        path: "/register",
+        name: "register",
+        meta: {
+          name: "娉ㄥ唽",
+          authentication: false,
+        },
+        component: () => import("@/views/login/register"),
+      },
+    ],
+  },
+  // 涓嶅湪涓绘鏋跺唴
+
+  {
+    path: "/findPassword",
+    name: "findPassword",
+    meta: {
+      name: "鐧诲綍",
+    },
+    component: () => import("@/views/login/findPassword"),
+  },
+];
+
+const router = new VueRouter({
+  routes,
+});
+
+export default router;
\ No newline at end of file

--
Gitblit v1.9.1