chore: restructure into monorepo and add open-source documentation
- Rename helix-server -> server and helix-web -> web - Remove helix-api (bruno collection and docs site) - Merge per-module .gitignore files into the root .gitignore - Add README, AGENTS, CONTRIBUTING and MIT LICENCE - Add full-stack docker-compose (postgres, redis, server, web via Caddy) with web Dockerfile, Caddyfile and Compose server config - Keep the Gradle wrapper jar tracked after the .gitignore merge - Copy gradle.properties into the server Docker build image
This commit is contained in:
315 files changed
+741
-7394
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { Navigate, Outlet, useLocation } from "react-router"
|
||||
import { useAppSelector } from "@/store"
|
||||
import DashboardLayout from "@/layouts/dashboard-layout"
|
||||
|
||||
/**
|
||||
* 需要身份验证的前置组件
|
||||
* @constructor
|
||||
*/
|
||||
export default function ProtectedRoute() {
|
||||
const isAuthenticated = useAppSelector((state) => state.auth.isAuthenticated)
|
||||
const location = useLocation()
|
||||
|
||||
if (!isAuthenticated) {
|
||||
return <Navigate to="/login" state={{ from: location }} replace />
|
||||
}
|
||||
|
||||
return (
|
||||
<DashboardLayout >
|
||||
<Outlet />
|
||||
</DashboardLayout>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user