为登录页面添加粒子背景、添加主页

This commit is contained in:
fanbook-wangdage
2026-01-29 12:19:44 +08:00
parent d4de66cd8a
commit 163248f90f
11 changed files with 905 additions and 11 deletions

View File

@@ -9,11 +9,16 @@ const routes = [
},
{
path: '/',
component: () => import('@/views/home/index.vue'),
meta: { hidden: true }
},
{
path: '/dashboard',
component: DefaultLayout,
redirect: '/dashboard',
redirect: '/dashboard/home',
children: [
{
path: 'dashboard',
path: 'home',
component: () => import('@/views/dashboard/index.vue'),
meta: { title: '首页', icon: 'House' },
},

View File

@@ -6,7 +6,8 @@ router.beforeEach(async (to, _ , next) => {
// 未登录
if (!userStore.token) {
if (to.path === '/login') {
// 主页(/)允许未登录访问
if (to.path === '/' || to.path === '/login') {
next()
} else {
next('/login')