index.js 1000 Bytes
import React from 'react';
import { Helmet } from 'react-helmet';
import { renderRoutes } from 'react-router-config';
import { BrowserRouter as Router, Switch } from 'react-router-dom';
import { appConnector } from './store';
import Authozed from '@/utils/authority';
import UserLogin from '@/pages/user/login';
import UserLayout from '@/layouts/UserLayout';
import { AUTHORITY, BASENAME } from '@/utils/constants';
export default appConnector(function App(props) {
  const { routesConfig } = props;
  return (
    <>
      <Helmet titleTemplate="%s - 运维平台" defaultTitle="运维平台">
        <meta name="description" content="运维平台" />
      </Helmet>
      <Router basename={BASENAME}>
        <Authozed
          noMatch={
            <UserLayout>
              <UserLogin />
            </UserLayout>
          }
          authority={[AUTHORITY.LOGIN]}
        >
          <Switch>{renderRoutes(routesConfig.routes)}</Switch>
        </Authozed>
      </Router>
    </>
  );
});