import Layout from '@/sheep/layouts/index.vue';
import { isEmpty } from 'lodash';

const shopRoutes = {
  path: '/shop/admin',
  name: 'shop.admin',
  component: Layout,
  meta: {
    title: '商城管理',
    menuStyle: 'qianniu',
  },
  children: [],
};

const routeFiles = import.meta.glob('../admin/**/*.service.js', { eager: true });

Object.keys(routeFiles).forEach((key) => {
  let route = routeFiles[key].route || {};
  if (!isEmpty(route)) {
    shopRoutes.children.push(route);
  }
});

export default shopRoutes;
