121 lines
3.2 KiB
JavaScript
Raw Normal View History

2025-01-25 02:48:00 +00:00
/*
* @Description: router
* @Author: zenghua.wang
* @Date: 2023-06-20 11:48:41
* @LastEditors: zenghua.wang
2025-04-07 10:28:47 +01:00
* @LastEditTime: 2025-04-07 17:24:45
2025-01-25 02:48:00 +00:00
*/
import { createRouter, createWebHistory } from 'vue-router';
import Layout from '@/layouts/index.vue';
import Views from '@/layouts/Views.vue';
2025-01-25 02:48:00 +00:00
export const constantRoutes = [
{
path: '/sub-operation-service/404',
2025-01-25 02:48:00 +00:00
name: '404',
component: () => import('@/views/error/404.vue'),
hidden: true,
},
{
path: '/sub-operation-service/403',
2025-01-25 02:48:00 +00:00
name: '403',
component: () => import('@/views/error/403.vue'),
hidden: true,
},
{
path: '/sub-operation-service',
2025-01-25 02:48:00 +00:00
name: 'layout',
component: Layout,
redirect: '/sub-operation-service/home',
2025-04-03 17:20:49 +08:00
meta: { title: '首页' },
2025-01-25 02:48:00 +00:00
children: [
{
path: '/sub-operation-service/home',
2025-01-25 02:48:00 +00:00
component: () => import('@/views/home/index.vue'),
name: 'home',
2025-04-03 17:20:49 +08:00
meta: { title: '首页' },
2025-01-25 02:48:00 +00:00
},
],
},
{
path: '/ecommerce',
name: 'ecommerce',
component: Layout,
2025-04-03 17:20:49 +08:00
redirect: '/sub-operation-service/ecommerce',
meta: { title: '电商交易' },
children: [
{
path: '/sub-operation-service/ecommerce',
component: () => import('@/views/ecommerce/index.vue'),
name: 'agricultural',
2025-04-03 17:20:49 +08:00
meta: { title: '农资交易' },
},
{
2025-04-03 17:20:49 +08:00
path: '/purchaser',
component: Views,
redirect: '/sub-operation-service/purchaser',
name: 'purchaserParent',
meta: { title: '采购商服务' },
children: [
{
path: '/sub-operation-service/purchaser',
component: () => import('@/views/ecommerce/purchaser.vue'),
name: 'purchaser',
meta: { title: '采购商服务' },
},
{
path: '/sub-operation-service/purchaserDetail',
component: () => import('@/views/ecommerce/purchaserDetail.vue'),
name: 'purchaserDetail',
meta: { title: '采购详情' },
},
],
},
2025-04-03 17:20:49 +08:00
{
path: '/sub-operation-service/supplier',
component: () => import('@/views/ecommerce/supplier.vue'),
name: 'supplier',
2025-04-03 17:20:49 +08:00
meta: { title: '供应商服务' },
},
{
2025-04-03 17:20:49 +08:00
path: '/land',
component: Views,
redirect: '/sub-operation-service/land',
name: 'landParent',
meta: { title: '土地交易' },
children: [
{
path: '/sub-operation-service/land',
component: () => import('@/views/ecommerce/land.vue'),
name: 'land',
meta: { title: '土地交易' },
},
{
path: '/sub-operation-service/landDetail',
component: () => import('@/views/ecommerce/landDetail.vue'),
name: 'landDetail',
meta: { title: '土地详情' },
},
],
},
],
},
2025-01-25 02:48:00 +00:00
];
/**
* @Title notFoundRouter(找不到路由)
*/
export const notFoundRouter = {
path: '/sub-operation-service/:pathMatch(.*)',
2025-01-25 02:48:00 +00:00
name: 'notFound',
redirect: '/sub-operation-service/404',
2025-01-25 02:48:00 +00:00
};
const router = createRouter({
history: createWebHistory(), // history
2025-01-25 02:48:00 +00:00
routes: constantRoutes,
});
export default router;