beefast-website/src/router/index.js
2025-03-25 09:26:01 +08:00

134 lines
2.8 KiB
JavaScript

import { createRouter, createWebHistory } from 'vue-router'
import Home from '../components/Home.vue'
import PrivacyAgreement from '../components/PrivacyAgreement.vue'
import UserAgreement from '../components/UserAgreement.vue'
import Dashboard from '../components/Dashboard.vue'
import HowToUse from '../components/HowToUse.vue'
import CommunityRequest from '../components/CommunityRequest.vue'
import PartnerRequest from '../components/PartnerRequest.vue'
import ImageRecognition from '../components/ImageRecognition.vue'
import SystemHealth from '../components/SystemHealth.vue'
import PdfViewer from '../components/PdfViewer.vue'
import MarkdownViewer from '../components/MarkdownViewer.vue'
import PlatformOrderPage from '../views/PlatformOrderPage.vue'
const routes = [
{
path: '/',
name: 'Home',
component: Home
},
{
path: '/privacy',
name: 'Privacy',
component: PrivacyAgreement,
meta: {
title: '隐私政策'
}
},
{
path: '/agreement',
name: 'Agreement',
component: UserAgreement,
meta: {
title: '用户服务协议'
}
},
{
path: '/dashboard',
name: 'Dashboard',
component: Dashboard,
meta: {
title: '数据大屏'
}
},
{
path: '/how-to-use',
name: 'HowToUse',
component: HowToUse,
meta: {
title: '快递服务流程'
}
},
{
path: '/community-request',
name: 'CommunityRequest',
component: CommunityRequest,
meta: {
title: '小区开通申请'
}
},
{
path: '/partner-request',
name: 'PartnerRequest',
component: PartnerRequest,
meta: {
title: '申请成为服务商/运营商'
}
},
{
path: '/image-recognition',
name: 'ImageRecognition',
component: ImageRecognition,
meta: {
title: '蜂快AI·快递取件码识别'
}
},
{
path: '/system-health',
name: 'SystemHealth',
component: SystemHealth,
meta: {
title: '系统健康状态',
requiresAuth: true
}
},
{
path: '/pdf-viewer',
name: 'PdfViewer',
component: PdfViewer,
meta: {
title: 'PDF查看器',
requiresAuth: false
}
},
{
path: '/markdown-viewer',
name: 'MarkdownViewer',
component: MarkdownViewer,
meta: {
title: 'Markdown查看器',
requiresAuth: false
}
},
{
path: '/md',
redirect: '/markdown-viewer'
},
{
path: '/platform/orders',
name: 'PlatformOrders',
component: PlatformOrderPage,
meta: {
title: '平台订单列表',
requiresAuth: true
}
}
]
const router = createRouter({
history: createWebHistory(),
routes
})
router.beforeEach((to, from, next) => {
document.title = '蜂快到家'
if (to.meta.title) {
document.title = to.meta.title
}
next()
})
export default router