import './styles/App.less' import React /*, { useContext, createContext, useState }*/ from "react" import { BrowserRouter as Router, Switch, Route, Redirect } from "react-router-dom" import Login from './pages/Login' import Main from './pages/Main' import {OpenAPI} from './services/api' OpenAPI.BASE = 'http://localhost:3000' OpenAPI.TOKEN = localStorage['token'] function PrivateRoute({ children, ...rest }) { let token = localStorage['token'] return ( token ? (children) : () } /> ); } export default function App() { return (
) }