feat: add main app route skeleton

This commit is contained in:
QiuSW
2026-07-08 23:06:48 +08:00
parent 4c1de99d65
commit 811a9c889f
16 changed files with 849 additions and 30 deletions
+67 -8
View File
@@ -1,13 +1,72 @@
import { createRouter, createWebHashHistory} from 'vue-router'
import MainPage from '../components/Main/Index.vue'
import SecondPage from '../pages/Home/Index.vue'
import { createRouter, createWebHashHistory, type RouteRecordRaw } from 'vue-router'
const routes = [
{ path: '/', component: MainPage },
{ path: '/second', component: SecondPage }
const routes: RouteRecordRaw[] = [
{
path: '/login',
name: 'login',
component: () => import('../modules/auth/LoginPage.vue'),
},
{
path: '/second',
name: 'second',
component: () => import('../pages/Home/Index.vue'),
},
{
path: '/',
component: () => import('../layouts/MainLayout.vue'),
redirect: '/dashboard',
children: [
{
path: 'dashboard',
name: 'dashboard',
component: () => import('../modules/dashboard/DashboardPage.vue'),
},
{
path: 'image-optimizer',
name: 'image-optimizer',
component: () => import('../modules/image-optimizer/ImageOptimizerPage.vue'),
},
{
path: 'business/image-optimizer',
redirect: '/image-optimizer',
},
{
path: 'logs',
name: 'logs',
component: () => import('../modules/logs/LogsPage.vue'),
},
{
path: 'logs/audit',
redirect: '/logs',
},
{
path: 'logs/app',
redirect: '/logs',
},
{
path: 'statistics',
name: 'statistics',
component: () => import('../modules/statistics/StatisticsPage.vue'),
},
{
path: 'settings',
name: 'settings',
component: () => import('../modules/settings/SettingsPage.vue'),
},
{
path: 'components',
name: 'components',
component: () => import('../modules/components-demo/ComponentsDemoPage.vue'),
},
],
},
{
path: '/:pathMatch(.*)*',
redirect: '/dashboard',
},
]
export default createRouter({
history: createWebHashHistory(), // Use createWebHashHistory for hash-based routing
history: createWebHashHistory(),
routes
})
})