/*
 * @Author: zzy 411037547@qq.com
 * @Date: 2023-05-26 10:05:48
 * @LastEditors: zzy 411037547@qq.com
 * @LastEditTime: 2023-05-26 11:15:58
 * @FilePath: \cloud-platform\src\app.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import './patchCssHmr';
import './global.less';
import globalState from './globalState';
// import { getMicroAppRouteComponent } from 'umi';

// 将全局state注入子应用
export function useQiankunStateForSlave() {
  return {
    globalState,
  };
}

// 注册子应用
export const qiankun = {
  apps: [
    {
      name: 'internalManage',
      // entry: '//dev.eshangtech.com:16060/merchantManagement/'
      entry: '//localhost:8888/internalManage/',
    },
  ],
}


// export const patchRoutes = ({ routes }: any) => {
//   console.info('routes', routes);
//   routes[0].routes[1].routes[0].routes.forEach((item: any, index: number) => {
//       if (item.microApp) {
//           routes[0].routes[1].routes[0].routes[index].component = (() => getMicroAppRouteComponent({
//               appName: item.microApp,
//               base: item.microAppProps?.base || '/',
//               masterHistoryType: item.microAppProps?.history || 'browser',
//               routeProps: {}
//           }))()
//       }
//   });
// }
