2025-01-20 08:09:54 +00:00
|
|
|
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';
|
|
|
|
import Layout from '@/layouts/index.vue';
|
|
|
|
|
|
|
|
export const constantRoutes = [
|
|
|
|
{
|
|
|
|
path: '/login',
|
|
|
|
name: 'login',
|
|
|
|
component: () => import('@/views/login/index.vue'),
|
|
|
|
hidden: true,
|
|
|
|
meta: {
|
|
|
|
title: '登录',
|
|
|
|
icon: 'Login',
|
|
|
|
},
|
|
|
|
},
|
2025-01-22 10:47:57 +08:00
|
|
|
{
|
|
|
|
path: '/platform',
|
|
|
|
component: () => import('@/views/index.vue'),
|
|
|
|
name: 'platform',
|
|
|
|
meta: { title: '平台入口', icon: 'House' },
|
|
|
|
},
|
2025-01-20 08:09:54 +00:00
|
|
|
{
|
|
|
|
path: '/',
|
|
|
|
name: 'layout',
|
|
|
|
component: Layout,
|
|
|
|
redirect: '/platform',
|
|
|
|
meta: { title: '平台入口', icon: 'House' },
|
|
|
|
children: [
|
|
|
|
{
|
2025-01-22 10:47:57 +08:00
|
|
|
path: '/home',
|
|
|
|
component: () => import('@/views/home.vue'),
|
|
|
|
name: 'home',
|
2025-01-20 08:09:54 +00:00
|
|
|
meta: { title: '平台入口', icon: 'House' },
|
|
|
|
},
|
2025-01-22 10:47:57 +08:00
|
|
|
{
|
2025-01-22 16:32:50 +08:00
|
|
|
path: '/sub-admin/:pathMatch(.*)*',
|
2025-01-22 10:47:57 +08:00
|
|
|
component: () => import('@/views/subApp.vue'),
|
|
|
|
name: 'sub-admin',
|
|
|
|
hidden: true,
|
|
|
|
meta: { title: '子应用入口', icon: 'House' },
|
|
|
|
},
|
2025-01-20 08:09:54 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const notFoundRouter = {
|
|
|
|
path: '/:pathMatch(.*)',
|
|
|
|
name: 'notFound',
|
|
|
|
redirect: '/404',
|
|
|
|
};
|
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
history: createWebHistory(),
|
|
|
|
routes: constantRoutes,
|
|
|
|
});
|
|
|
|
|
|
|
|
export default router;
|