diff --git a/frontend/src/components/LoginModal.jsx b/frontend/src/components/LoginModal.jsx index 49ee9cf..6fbaada 100644 --- a/frontend/src/components/LoginModal.jsx +++ b/frontend/src/components/LoginModal.jsx @@ -64,7 +64,7 @@ const LoginModal = ({ visible, onClose, onLoginSuccess }) => { open={visible} onCancel={onClose} footer={null} - destroyOnClose + destroyOnClose={true} centered >
{ const { id } = useParams(); const navigate = useNavigate(); const queryClient = useQueryClient(); const { scrollY } = useScroll(); + const { login } = useAuth(); + const [loginVisible, setLoginVisible] = useState(false); // Header animation: transparent to white with shadow const headerBg = useTransform(scrollY, [0, 60], ['rgba(255,255,255,0)', 'rgba(255,255,255,1)']); @@ -71,6 +75,11 @@ const ActivityDetail = () => { }; const handleSignUp = () => { + if (!localStorage.getItem('token')) { + message.warning('请先登录后报名'); + setLoginVisible(true); + return; + } signUpMutation.mutate(); };