diff --git a/Merge/front/src/components/RequireAuth.jsx b/Merge/front/src/components/RequireAuth.jsx
new file mode 100644
index 0000000..e217e4f
--- /dev/null
+++ b/Merge/front/src/components/RequireAuth.jsx
@@ -0,0 +1,13 @@
+// src/components/RequireAuth.jsx
+import React from 'react'
+import { Navigate, useLocation } from 'react-router-dom'
+import { isLoggedIn } from '../utils/auth'
+
+export function RequireAuth({ children }) {
+  const location = useLocation()
+  if (!isLoggedIn()) {
+    // 未登录跳到 /login，并保存当前尝试访问的地址
+    return <Navigate to="/login" replace state={{ from: location }} />
+  }
+  return children
+}
