import React, { useState } from 'react'
import { withRouter, matchPath } from 'dva/router'
import Header from './Header'
import Sider from './Sider'
import AlarmEditModal from '../components/Edit/AlarmEditModal'
import { $consts } from '../plugins'
import './main.less'
const BackendLayout = (props) => {
return (
)
}
const MainLayout = (props) => {
const { pathname } = props.location
const matchLogin = matchPath(pathname, {
path: $consts['ROUTE/LOGIN'],
exact: true,
strict: true
})
let matchHome =false;
const [matchPost, setMatchPost] = useState(false)
/** 手机端隐藏 */
if (window.navigator.userAgent.indexOf("Windows") < 1)
{
matchHome =true
}
const repost=()=>{
setMatchPost(!matchPost)
}
return (
)
}
class Main extends React.Component {
render () {
const { pathname } = this.props.location
const matchBackend = matchPath(pathname, {
path: $consts['ROUTE/BACKEND'],
exact: true,
strict: true
})
const matchLogin = matchPath(pathname, {
path: $consts['ROUTE/LOGIN'],
exact: true,
strict: true
})
return (
{matchBackend ? : }
{/* 去掉首页报警框 */}
{/* {matchLogin ? null : } */}
)
}
}
export default withRouter(Main)