// src/router.ts import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'; const routes: RouteRecordRaw[] = [ { path: '/h5-install', component: () => import('./pages/mobile/h5-install.vue'), }, { path: '/b', component: () => import('./pages/land-b/index.vue'), }, { path: '/works', redirect: (to) => ({ path: '/b', query: { ...to.query, view: 'works' }, hash: to.hash }), }, { path: '/', component: () => import('./pages/index.vue'), }, { // Google 会导向 /lander,统一回首页;保留 query 与 hash,避免丢失 dc / uid 等渠道参数 path: '/lander', redirect: (to) => ({ path: '/', query: to.query, hash: to.hash }), }, ]; const router = createRouter({ history: createWebHistory(), routes, }); export default router;