import { createBrowserRouter, RouteObject } from 'react-router-dom';
import { RouteObjectType, routerList, whiteRouterList } from '~/router/router';

// 获取用户权限路由列表
export const authRouterList = () => {
  // TODO: 在此处对用户权限进行判断，返回不同的路由表
  return [...routerList];
};
// 整合路由数据
export const routes = [...authRouterList(), ...whiteRouterList];
// 导出路由表
export const router = createBrowserRouter(routes);
// 路由表类型
export type routerItem = RouteObject & RouteObjectType;
