2021-04-02 17:22:34 +05:00
|
|
|
import './styles/App.less'
|
|
|
|
import {
|
|
|
|
BrowserRouter as Router,
|
|
|
|
Switch,
|
2021-04-09 17:59:35 +05:00
|
|
|
Route} from "react-router-dom"
|
2021-08-17 13:01:13 +05:00
|
|
|
import {ConfigProvider} from 'antd'
|
|
|
|
import locale from "antd/lib/locale/ru_RU"
|
2021-04-02 17:22:34 +05:00
|
|
|
import Login from './pages/Login'
|
2021-10-21 17:27:53 +05:00
|
|
|
import Register from './pages/Register'
|
2021-04-02 17:22:34 +05:00
|
|
|
import Main from './pages/Main'
|
2021-04-09 17:59:35 +05:00
|
|
|
import { OpenAPI } from './services/api'
|
2021-09-03 14:27:00 +05:00
|
|
|
import { PrivateRoute } from './components/Private'
|
2021-03-31 15:54:02 +05:00
|
|
|
|
2021-07-26 14:40:35 +05:00
|
|
|
//OpenAPI.BASE = 'http://localhost:3000'
|
2021-04-02 17:22:34 +05:00
|
|
|
OpenAPI.TOKEN = localStorage['token']
|
|
|
|
|
|
|
|
export default function App() {
|
|
|
|
return (
|
2021-08-17 13:01:13 +05:00
|
|
|
<ConfigProvider locale={locale}>
|
|
|
|
<Router>
|
2021-04-02 17:22:34 +05:00
|
|
|
<Switch>
|
|
|
|
<Route path="/login">
|
|
|
|
<Login />
|
|
|
|
</Route>
|
2021-10-21 17:27:53 +05:00
|
|
|
<Route path="/register">
|
|
|
|
<Register />
|
|
|
|
</Route>
|
2021-04-02 17:22:34 +05:00
|
|
|
<PrivateRoute path="/">
|
|
|
|
<Main />
|
|
|
|
</PrivateRoute>
|
|
|
|
</Switch>
|
2021-08-17 13:01:13 +05:00
|
|
|
</Router>
|
|
|
|
</ConfigProvider>
|
|
|
|
);
|
2021-04-02 17:22:34 +05:00
|
|
|
}
|