import 'antd/dist/antd.min.css';
import '@/assets/styles/base.css'
// import { useDispatch, useSelector } from 'react-redux'
// import { RootState } from './store'
// import { addNunAction } from './store/action/login'

// 关于路由
import React, { useEffect } from "react"
import { Router, Route, Switch, Redirect } from "react-router-dom"
import history from "./utils/history"
const HomeM = React.lazy(() => import('./pages/HomeM'))
const ModelM = React.lazy(() => import('./pages/ModelM'))

export default function AppM() {

  useEffect(() => {
    const dom: any = document.querySelector(".AppM")
    dom.style.height = window.innerHeight + "px";
  }, [])

  // const dispatch = useDispatch()
  return (
    <div className='AppM'>
      {/* 关于路由 */}
      <Router history={history}>
        <React.Suspense fallback={<div className='lodingApp'>加载中...</div>}>
          <Switch>
            <Redirect exact path="/" to="Home" />
            <Route path="/Model" component={ModelM} />
            <Route path="/Home" component={HomeM} />
          </Switch>
        </React.Suspense>
      </Router>
    </div>

  )
}
