import { Outlet } from 'umi';
import './index.less';
import { useSearchParams } from 'umi';
import { useEffect } from 'react';
import zhCN from 'antd/locale/zh_CN';
import dayjs from 'dayjs';
import { ConfigProvider } from "antd";

dayjs.locale('zh-cn')

export default function Layout() {
  const [searchParams] = useSearchParams();

  useEffect(() => {
    const enterpriseCode = searchParams.get('enterpriseCode');
  
    if(enterpriseCode) {
      sessionStorage.setItem('enterpriseCode', enterpriseCode);
    }
  }, [searchParams]);
  return (
    <ConfigProvider locale={zhCN}>
      <Outlet />
    </ConfigProvider>
  );
}
