Replaced HashRouter with BrowserRouter
parent
3842e31dd8
commit
1368c6e97b
2
.env
2
.env
|
@ -1,2 +1,4 @@
|
||||||
REACT_APP_IDENTITY_AUTHENTICATION_URL=https://toodle.ddns.net/identity-server-api/identity/authenticate?UserName={username}&Password={password}
|
REACT_APP_IDENTITY_AUTHENTICATION_URL=https://toodle.ddns.net/identity-server-api/identity/authenticate?UserName={username}&Password={password}
|
||||||
REACT_APP_ENABLE_TEMPLATE_CONTENT=True
|
REACT_APP_ENABLE_TEMPLATE_CONTENT=True
|
||||||
|
|
||||||
|
#PUBLIC_URL=/cdn-admin/
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { HashRouter, Route, Switch, Redirect } from "react-router-dom";
|
import { BrowserRouter, Route, Switch, Redirect } from "react-router-dom";
|
||||||
|
|
||||||
// components
|
// components
|
||||||
import Layout from "./Layout/Layout";
|
import Layout from "./Layout/Layout";
|
||||||
|
@ -24,14 +24,14 @@ export default function App() {
|
||||||
}, [messageCode, t, notify]);
|
}, [messageCode, t, notify]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HashRouter basename={process.env.PUBLIC_URL || ""}>
|
<BrowserRouter basename={process.env.PUBLIC_URL || ""}>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route exact path="/" render={() => <Redirect to="/dashboard" />} />
|
<Route exact path="/" render={() => <Redirect to="/dashboard" />} />
|
||||||
<PublicRoute path="/login" component={Login} />
|
<PublicRoute path="/login" component={Login} />
|
||||||
<PrivateRoute path="/" component={Layout} />
|
<PrivateRoute path="/" component={Layout} />
|
||||||
<Route component={Error} />
|
<Route component={Error} />
|
||||||
</Switch>
|
</Switch>
|
||||||
</HashRouter>
|
</BrowserRouter>
|
||||||
);
|
);
|
||||||
|
|
||||||
function PrivateRoute({ component, ...rest }) {
|
function PrivateRoute({ component, ...rest }) {
|
||||||
|
|
Loading…
Reference in New Issue