From d92ba25089a1336541198aec2b0e200a27c371ce Mon Sep 17 00:00:00 2001 From: goodm2ice Date: Wed, 12 Jan 2022 20:49:30 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=BE=D0=BA=D0=B5=D0=BD=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20OpenAPI=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B4=D0=B0=D1=91=D1=82=D1=81=D1=8F=20=D0=B0=D1=81?= =?UTF-8?q?=D0=B8=D0=BD=D1=85=D1=80=D0=BE=D0=BD=D0=BD=D1=8B=D0=BC=20=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D0=BE=D0=B4=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 55 +++++++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/src/App.js b/src/App.js index 6531f77..f568f6c 100644 --- a/src/App.js +++ b/src/App.js @@ -1,36 +1,41 @@ -import './styles/App.less' import { BrowserRouter as Router, Switch, - Route} from "react-router-dom" -import {ConfigProvider} from 'antd' -import locale from "antd/lib/locale/ru_RU" -import Login from './pages/Login' -import Register from './pages/Register' -import Main from './pages/Main' + Route +} from 'react-router-dom' +import { ConfigProvider } from 'antd' +import locale from 'antd/lib/locale/ru_RU' + import { OpenAPI } from './services/api' +import { getUserToken } from './utils/storage' import { PrivateRoute } from './components/Private' +import Main from './pages/Main' +import Login from './pages/Login' +import Register from './pages/Register' + +import './styles/App.less' + //OpenAPI.BASE = 'http://localhost:3000' -OpenAPI.TOKEN = localStorage.getItem('token') +OpenAPI.TOKEN = async () => getUserToken() OpenAPI.HEADERS = {'Content-Type': 'application/json'} -export default function App() { - return ( +export const App = () => ( - - - - - - - - - -
- - - + + + + + + + + + +
+ + + - ); -} \ No newline at end of file +) + +export default App