import type { RouteRecordRaw } from 'vue-router'

const Layout = () => import('@/layouts/index.vue')

const routes: RouteRecordRaw[] = [
  {
    path: '/api',
    component: Layout,
    redirect: '/api/index',
    name: 'api',
    meta: {
      title: 'API管理',
      icon: 'ep:grape',
    },
    children: [
      {
        path: 'index',
        name: 'api_index',
        component: () => import('@/views/api/api/index.vue'),
        meta: {
          title: 'API接口',
          sidebar: false,
          breadcrumb: false,
          activeMenu: '/api',
        },
      },
    ],
  },
  {
    path: '/api/log',
    component: Layout,
    redirect: '/api/log/index',
    name: 'api_log',
    meta: {
      title: 'API日志',
      icon: 'ep:hot-water',
    },
    children: [
      {
        path: 'index',
        name: 'api_log_index',
        component: () => import('@/views/api/log/index.vue'),
        meta: {
          title: '调用日志',
          sidebar: false,
          breadcrumb: false,
          activeMenu: '/api/log',
        },
      },
    ],
  },
]
export default routes
