48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import type { RouteRecordRaw } from 'vue-router'
|
|
|
|
export const publicRoutes: RouteRecordRaw[] = [
|
|
{
|
|
path: '/',
|
|
name: 'home',
|
|
component: () => import('@/features/listings/views/HomeView.vue'),
|
|
},
|
|
{
|
|
path: '/listings/collections',
|
|
name: 'listing-collections',
|
|
component: () => import('@/features/listings/views/ListingCollectionsView.vue'),
|
|
},
|
|
{
|
|
path: '/listings/:id',
|
|
name: 'listing-detail',
|
|
component: () => import('@/features/listings/views/ListingDetailView.vue'),
|
|
},
|
|
// 撞车 PC 端;移动端访问会被守卫重写到 /m/crash*
|
|
{
|
|
path: '/crash',
|
|
name: 'crash-list',
|
|
component: () => import('@/features/mohong/views/MohongListView.vue'),
|
|
},
|
|
{
|
|
// 撞车订单列表统一到「我的订单」页(与租赁订单混排)
|
|
path: '/crash/orders',
|
|
name: 'crash-orders',
|
|
redirect: '/orders',
|
|
},
|
|
{
|
|
path: '/crash/orders/:id',
|
|
name: 'crash-order-detail',
|
|
component: () => import('@/features/mohong/views/MohongOrderDetailView.vue'),
|
|
meta: { requiresAuth: true },
|
|
},
|
|
{
|
|
path: '/crash/:id',
|
|
name: 'crash-detail',
|
|
component: () => import('@/features/mohong/views/MohongDetailView.vue'),
|
|
},
|
|
// 旧路径兼容
|
|
{ path: '/mohong', redirect: '/crash' },
|
|
{ path: '/mohong/orders', redirect: '/crash/orders' },
|
|
{ path: '/mohong/orders/:id', redirect: to => `/crash/orders/${to.params.id}` },
|
|
{ path: '/mohong/:id', redirect: to => `/crash/${to.params.id}` },
|
|
]
|