diff --git a/src/components/AuthButton.jsx b/src/components/AuthButton.jsx
new file mode 100644
index 0000000..b5cc431
--- /dev/null
+++ b/src/components/AuthButton.jsx
@@ -0,0 +1,22 @@
+import {useContext} from "react";
+import { UserContext } from "../context/UserContext";
+import toast from "react-hot-toast";
+const AuthButton = ({children, roles,onClick, ...rest }) => {
+    const {user} = useContext(UserContext);
+    const {levelRole} = user;
+    let clickFunc = onClick
+    if(!roles || roles.length === 0 || roles.includes(levelRole)){
+      clickFunc = onClick;
+    }else{
+        clickFunc = () => {
+            toast.error("权限不足");
+        }
+    }
+   
+    return (
+        <button onClick={clickFunc} {...rest}>
+            {children}
+        </button>
+    )
+}
+export default AuthButton;
\ No newline at end of file
