mirror of
https://github.com/lemeow125/Ivy-Frontend.git
synced 2024-11-17 06:39:25 +08:00
Revert to browser router
This commit is contained in:
parent
8af4b9b3ac
commit
5d8610056b
3 changed files with 85 additions and 84 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "ivy-inventorymanager",
|
||||
"version": "0.1.0",
|
||||
"homepage": "https://lemeow125.github.io/Ivy",
|
||||
"homepage": "https://lemeow125.github.io/Ivy/#",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.10.5",
|
||||
|
|
11
src/App.tsx
11
src/App.tsx
|
@ -7,7 +7,11 @@ import Container from "./Components/Container/Container";
|
|||
import {
|
||||
createBrowserRouter,
|
||||
createHashRouter,
|
||||
HashRouter,
|
||||
Navigate,
|
||||
Route,
|
||||
RouterProvider,
|
||||
Routes,
|
||||
} from "react-router-dom";
|
||||
import Store from "./Plugins/Redux/Store/Store";
|
||||
import { Provider } from "react-redux";
|
||||
|
@ -21,8 +25,7 @@ import Register from "./Routes/Register/Register";
|
|||
|
||||
const queryClient = new QueryClient();
|
||||
|
||||
const router = createHashRouter(
|
||||
[
|
||||
const router = createBrowserRouter([
|
||||
{
|
||||
path: "/",
|
||||
element: (
|
||||
|
@ -100,9 +103,7 @@ const router = createHashRouter(
|
|||
</Container>
|
||||
),
|
||||
},
|
||||
],
|
||||
{ basename: "/Ivy" }
|
||||
);
|
||||
]);
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
|
|
|
@ -14,7 +14,7 @@ export default function LoginChecker() {
|
|||
if (!logged_in && !old_session_checked) {
|
||||
} else if (!logged_in && old_session_checked) {
|
||||
console.log("Not logged in. Redirecting to login page");
|
||||
return <Navigate to="/Login" replace />;
|
||||
return <Navigate to="Ivy/Login" replace />;
|
||||
}
|
||||
return <div />;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue