mirror of
https://github.com/wangdage12/Snap.Server.Web.git
synced 2026-02-17 10:02:08 +08:00
为登录页面添加粒子背景、添加主页
This commit is contained in:
@@ -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' },
|
||||
},
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user