From bde761864bffcb9769c32eb77a489fb56b9c4f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wei=5F=E4=BD=B3?= Date: Mon, 17 Nov 2025 18:15:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=B7=AF=E7=94=B1=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=90=8E=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增/home路由指向独立首页组件 - 将根路径重定向从/pages改为/home - 更新登录成功后默认跳转路径为/home - 设置首页路由为隐藏状态,不在菜单中显示 --- web1/src/router/routes/index.js | 11 ++- web1/src/views/home/index.vue | 163 ++++++++++++++++++++++++++++++++ web1/src/views/login/index.vue | 2 +- 3 files changed, 174 insertions(+), 2 deletions(-) create mode 100644 web1/src/views/home/index.vue diff --git a/web1/src/router/routes/index.js b/web1/src/router/routes/index.js index ed33d7e..f1c7101 100644 --- a/web1/src/router/routes/index.js +++ b/web1/src/router/routes/index.js @@ -6,9 +6,18 @@ const Layout = () => import('@/layout/index.vue') export const basicRoutes = [ { path: '/', - redirect: '/pages', // 默认跳转到首页 + redirect: '/home', // 默认跳转到首页 meta: { order: 0 }, }, + { + name: 'Home', + path: '/home', + component: () => import('@/views/home/index.vue'), + isHidden: true, + meta: { + title: '首页', + }, + }, { name: t('views.workbench.label_workbench'), path: '/workbench', diff --git a/web1/src/views/home/index.vue b/web1/src/views/home/index.vue new file mode 100644 index 0000000..ecb4be0 --- /dev/null +++ b/web1/src/views/home/index.vue @@ -0,0 +1,163 @@ + + + + + diff --git a/web1/src/views/login/index.vue b/web1/src/views/login/index.vue index 9917fb6..07eb5bb 100644 --- a/web1/src/views/login/index.vue +++ b/web1/src/views/login/index.vue @@ -182,7 +182,7 @@ async function handleLogin() { Reflect.deleteProperty(query, 'redirect') router.push({ path, query }) } else { - router.push('/') + router.push('/home') } } })