import { createRouter, createWebHistory } from 'vue-router';
import Layout from '@/components/layout/index.vue';

export const staticRoutes = [];

const systemRoutes = [
	{
		path: '/',
		name: 'Main',
		component: Layout,
		meta: {
			title: '首页',
			icon: 'icon-cangku',
		},
		hidden: true,
		redirect: '/index',
		children: [
			{
				path: '/index',
				name: 'Index',
				meta: {
					title: '首页',
					icon: 'el-icon-s-home',
				},
				component: () => import('../views/index/index.vue'),
			},
		],
	},
	{
		path: '/login',
		name: 'Login',
		hidden: true,
		component: () => import('../views/login/index.vue'),
		meta: {
			title: '登录页',
		},
	},
	{
		path: '/404',
		name: '404',
		hidden: true,
		component: () => import('../views/public/404.vue'),
		meta: {
			title: '页面未找到',
		},
	},
];

const router = createRouter({
	history: createWebHistory(import.meta.env.BASE_URL),
	routes: systemRoutes,
});

export default router;
