App.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import React from "react";
  2. import { Route, Routes } from "react-router-dom";
  3. import { ConfigProvider } from "antd";
  4. import zhCN from "antd/lib/locale/zh_CN";
  5. import { MemoSpinLoding } from "./components";
  6. import theme from "./theme.scss";
  7. import "./App.scss";
  8. import "./configure";
  9. const Login = React.lazy(() => import("./pages/Login"));
  10. const Layout = React.lazy(() => import("./pages/Layout"));
  11. const Zhlocale: typeof zhCN = zhCN;
  12. if (Zhlocale.DatePicker?.lang) {
  13. Zhlocale.DatePicker.lang = {
  14. ...Zhlocale.DatePicker.lang,
  15. monthFormat: "M月",
  16. shortWeekDays: ["日", "一", "二", "三", "四", "五", "六"],
  17. };
  18. }
  19. function App() {
  20. return (
  21. <div className="App">
  22. <ConfigProvider
  23. locale={Zhlocale}
  24. theme={{ token: { colorPrimary: theme.primaryColor } }}
  25. >
  26. <React.Suspense fallback={<MemoSpinLoding />}>
  27. <Routes>
  28. <Route path="/login" Component={Login} />
  29. <Route path="/*" Component={Layout} />
  30. </Routes>
  31. </React.Suspense>
  32. </ConfigProvider>
  33. </div>
  34. );
  35. }
  36. export default App;