From c0f55c89a32df439aa2c82d9ca88c4cee8c5d86d Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期四, 21 八月 2025 18:01:47 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/xiehe_website --- src/router/index.js | 268 +++++++++++++++++++++++++---------------------------- 1 files changed, 126 insertions(+), 142 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 8175b50..839faac 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,149 +1,133 @@ -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 bookStore from "./modules/bookStore"; -import teachingServices from "./modules/teachingServices"; -import informationCenterRouter from "./modules/informationCenter"; -import aboutUs from "./modules/aboutUs"; -import preview from "./modules/preview" -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: [ - // 鍦ㄤ富妗嗘灦鍐� +import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router' +import HomeView from '../views/home/index.vue' +import aboutUs from '../views/aboutUs/index.vue' +import bookStore from '../views/bookStore/index.vue' +import bookdetail from '../views/bookStore/detail.vue' +import PageLayout from '../layout/baseLayout.vue' +const router = createRouter({ + history: createWebHashHistory(import.meta.env.BASE_URL), + routes: [ { - 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, // 鏄惁闇�瑕佺紦瀛� + path: '/', + name: 'layout', + component: PageLayout, + redirect: { name: 'home' }, + children: [ + { + path: '/home', + name: 'home', + component: HomeView, }, - component: Home, - }, - { - path: "search", - name: "search", - meta: { - name: "棣栭〉鎼滅储", - authentication: false, // 鏄惁闇�瑕佺櫥褰曢獙璇� - keepAlive: true, // 鏄惁闇�瑕佺紦瀛� + { + path: '/aboutUs', + name: 'aboutUs', + component: aboutUs, }, - component: Search, - }, + { + path: '/bookdetail', + name: 'bookdetail', + component: bookdetail, + }, + { + path: '/bookStore', + name: 'bookStore', + component: bookStore, + }, + //涓汉涓績 + { + path: '/personalCenter', + name: 'personalCenter', + redirect: '/userInfo', + meta: { + name: '涓汉涓績', + }, + component: () => import('@/views/personalCenter/index.vue'), + children: [ + { + path: '/userInfo', + name: 'userInfo', + meta: { + name: '璐︽埛淇℃伅', + }, + component: () => import('@/views/personalCenter/userInfo.vue'), + }, + { + path: '/myCart', + name: 'myCart', + meta: { + name: '璐墿杞�', + }, + component: () => import('@/views/personalCenter/myCart.vue'), + }, + { + path: '/myBook', + name: 'myBook', + meta: { + name: '鍥句功', + }, + component: () => import('@/views/personalCenter/myBook.vue'), + }, + { + path: '/myCourse', + name: 'myCourse', + meta: { + name: '璇剧▼', + }, + component: () => import('@/views/personalCenter/course.vue'), + }, + { + path: '/myClass', + name: 'myClass', + meta: { + name: '鐝骇', + }, + component: () => import('@/views/personalCenter/class.vue'), + }, + { + path: '/myOrder', + name: 'myOrder', + meta: { + name: '璁㈠崟', + }, + component: () => import('@/views/personalCenter/myOrder.vue'), + }, + { + path: '/myApply', + name: 'myApply', + meta: { + name: '鐢宠', + }, + component: () => import('@/views/personalCenter/myApply.vue'), + }, + { + path: '/myCollection', + name: 'myCollection', + meta: { + name: '鏀惰棌', + }, + component: () => import('@/views/personalCenter/myCollection.vue'), + }, + { + path: '/myMessage', + name: 'myMessage', + meta: { + name: '娑堟伅', + }, + component: () => import('@/views/personalCenter/myMessage.vue'), + }, + { + path: '/activateProduct', + name: 'activateProduct', + meta: { + name: '婵�娲荤爜', + }, + component: () => import('@/views/personalCenter/activeCode.vue'), + }, + ], + }, ], }, - { - 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: "/personalCenter", - name: "personalCenter", - meta: { - name: "涓汉涓績", - authentication: true, - }, - component: () => import("@/views/personalCenter"), - }, - { - path: "/authorServices", - name: "authorServices", - meta: { - name: "浣滆�呮湇鍔�", - authentication: false, - }, - component: () => import("@/views/authorServices"), - }, - { - path: "/bindWeChat", - name: "bindWeChat", - meta: { - name: "缁戝畾寰俊", - authentication: true, - }, - component: () => import("@/views/bindWeChat"), - }, - { - path: "/bindWeChatBack", - name: "bindWeChatBack", - meta: { - name: "缁戝畾寰俊", - authentication: true, - }, - component: () => import("@/views/bindWeChat/success"), - }, - { - path: "/AdminLogin", - name: "AdminLogin", - meta: { - name: "绠$悊鐧诲綍", - noWrapHeadFooter: true, - }, - component: () => import("@/views/login/adminLogin"), - }, - ...bookStore, - ...teachingServices, - ...informationCenterRouter, - ...aboutUs, - ...preview ], -}, -// 涓嶅湪涓绘鏋跺唴 +}) -{ - 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 +export default router -- Gitblit v1.9.1