beefast-website/src/router/index.js
2025-03-07 14:54:17 +08:00

90 lines
1.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'
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: '快递取件码识别'
}
}
]
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