2025-01-23 01:10:59 +00:00
|
|
|
/*
|
|
|
|
* @Description: router
|
|
|
|
* @Author: zenghua.wang
|
|
|
|
* @Date: 2023-06-20 11:48:41
|
2025-01-23 09:27:53 +00:00
|
|
|
* @LastEditors: zenghua.wang
|
2025-02-27 01:24:25 +00:00
|
|
|
* @LastEditTime: 2025-02-18 11:22:07
|
2025-01-23 01:10:59 +00:00
|
|
|
*/
|
2025-01-23 09:27:53 +00:00
|
|
|
import { createRouter, createWebHistory } from 'vue-router';
|
2025-01-23 01:10:59 +00:00
|
|
|
import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper';
|
|
|
|
import Layout from '@/layouts/index.vue';
|
|
|
|
|
|
|
|
import resourceRouter from './modules/resource';
|
2025-01-23 09:27:53 +00:00
|
|
|
import plantingAndBreedingRouter from './modules/plantingAndBreeding';
|
2025-02-26 13:36:43 +08:00
|
|
|
import landsRoutes from './modules/lands';
|
2025-01-23 01:10:59 +00:00
|
|
|
|
|
|
|
const { VITE_APP_NAME } = import.meta.env;
|
|
|
|
|
|
|
|
export const constantRoutes = [
|
|
|
|
{
|
|
|
|
path: '/404',
|
|
|
|
name: '404',
|
|
|
|
component: () => import('@/views/error/404.vue'),
|
|
|
|
hidden: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/403',
|
|
|
|
name: '403',
|
|
|
|
component: () => import('@/views/error/403.vue'),
|
|
|
|
hidden: true,
|
|
|
|
},
|
2025-02-27 01:24:25 +00:00
|
|
|
// {
|
|
|
|
// path: '/login',
|
|
|
|
// name: 'login',
|
|
|
|
// component: () => import('@/views/error/404.vue'),
|
|
|
|
// hidden: true,
|
|
|
|
// meta: {
|
|
|
|
// title: '登录',
|
|
|
|
// icon: 'Login',
|
|
|
|
// },
|
|
|
|
// },
|
2025-01-23 01:10:59 +00:00
|
|
|
{
|
|
|
|
path: '/',
|
|
|
|
name: 'layout',
|
|
|
|
component: Layout,
|
|
|
|
redirect: '/home',
|
|
|
|
meta: { title: '政务服务', icon: 'House' },
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '/home',
|
|
|
|
component: () => import('@/views/home/index.vue'),
|
|
|
|
name: 'home',
|
2025-02-17 06:43:55 +00:00
|
|
|
meta: { title: '首页', icon: 'House' },
|
2025-01-23 01:10:59 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2025-02-27 01:24:25 +00:00
|
|
|
...resourceRouter,
|
2025-01-23 09:27:53 +00:00
|
|
|
...plantingAndBreedingRouter,
|
2025-02-26 13:36:43 +08:00
|
|
|
...landsRoutes,
|
2025-01-23 01:10:59 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Title notFoundRouter(找不到路由)
|
|
|
|
*/
|
|
|
|
export const notFoundRouter = {
|
2025-02-27 01:24:25 +00:00
|
|
|
path: '/:pathMatch(.*)',
|
|
|
|
name: 'notFound',
|
|
|
|
redirect: '/404',
|
2025-01-23 01:10:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
history: createWebHistory(qiankunWindow.__POWERED_BY_QIANKUN__ ? `/${VITE_APP_NAME}/` : '/'), // history
|
|
|
|
routes: constantRoutes,
|
|
|
|
});
|
|
|
|
|
|
|
|
export default router;
|