feat: update routing to redirect to tool paths

- Modified router configuration to set default redirects for the root and wildcard paths to "/tool" and "/tool/uuid".
- Simplified loader functions for cleaner code.
This commit is contained in:
typist
2025-10-28 00:55:48 +08:00
parent f7f34e2797
commit 401678c86e

View File

@@ -24,7 +24,7 @@ const router = createBrowserRouter([
)), )),
{ {
index: true, index: true,
element: null, loader: () => redirect("/tool/uuid"),
}, },
] ]
}, },
@@ -32,15 +32,11 @@ const router = createBrowserRouter([
}, },
{ {
index: true, index: true,
loader: () => { loader: () => redirect("/tool"),
return redirect("/tool");
},
}, },
{ {
path: "*", path: "*",
loader: () => { loader: () => redirect("/tool"),
return redirect("/tool");
},
}, },
]); ]);