From e5a1ef14230d7e3e0fa5ecb9e5c2f28837447231 Mon Sep 17 00:00:00 2001
From: lbw <1192299468@qq.com>
Date: Mon, 15 Dec 2025 11:22:18 +0800
Subject: [PATCH] =?UTF-8?q?refactor(router):=20=E8=B0=83=E6=95=B4=E9=A6=96?=
=?UTF-8?q?=E9=A1=B5=E8=B7=AF=E7=94=B1=E6=8C=87=E5=90=91=E7=8F=AD=E7=BA=A7?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将首页路由组件由Index改为Class
- 修改首页路由的meta标题为“班级”
- 删除原有的/class路由配置
- 更新Header组件中“班级”链接指向根路径
- 修改全局路由守卫处理页面标题格式为“标题 - Enlish”
---
enlish-vue/src/layouts/components/Header.vue | 2 +-
enlish-vue/src/permission.js | 2 +-
enlish-vue/src/router/index.js | 11 ++---------
3 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/enlish-vue/src/layouts/components/Header.vue b/enlish-vue/src/layouts/components/Header.vue
index 77e9dff..cd3c165 100644
--- a/enlish-vue/src/layouts/components/Header.vue
+++ b/enlish-vue/src/layouts/components/Header.vue
@@ -39,7 +39,7 @@
班级
diff --git a/enlish-vue/src/permission.js b/enlish-vue/src/permission.js
index d19071d..2820cd0 100644
--- a/enlish-vue/src/permission.js
+++ b/enlish-vue/src/permission.js
@@ -14,7 +14,7 @@ router.beforeEach((to, from, next) => {
// 全局路由后置守卫
router.afterEach((to, from) => {
// 动态设置页面 Title
- let title = (to.meta.title ? to.meta.title : '') + ' - Weblog'
+ let title = (to.meta.title ? to.meta.title : '') + ' - Enlish'
document.title = title
// 隐藏页面加载 Loading
diff --git a/enlish-vue/src/router/index.js b/enlish-vue/src/router/index.js
index d0d6374..d5c524e 100644
--- a/enlish-vue/src/router/index.js
+++ b/enlish-vue/src/router/index.js
@@ -7,9 +7,9 @@ import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [
{
path: '/', // 路由地址
- component: Index, // 对应组件
+ component: Class, // 对应组件
meta: { // meta 信息
- title: '首页' // 页面标题
+ title: '班级' // 页面标题
}
},
{
@@ -18,13 +18,6 @@ const routes = [
meta: { // meta 信息
title: '上传图片' // 页面标题
}
- },
- {
- path: '/class', // 路由地址
- component: Class, // 对应组件
- meta: { // meta 信息
- title: '班级' // 页面标题
- }
}
]