diff --git a/src/components/auth/LoginModal.tsx b/src/components/auth/LoginModal.tsx index ab2eae2b..798349b9 100644 --- a/src/components/auth/LoginModal.tsx +++ b/src/components/auth/LoginModal.tsx @@ -1,7 +1,7 @@ "use client"; import { useCallback, useEffect, useRef, useState } from "react"; -import { Alert, Button, Input, Modal, Segmented } from "antd"; +import { Alert, Button, Checkbox, Input, Modal, Segmented } from "antd"; import { useI18n } from "@/i18n"; import { useLoginModalStore } from "@/store/loginModalStore"; import { useUserStore } from "@/store/userStore"; @@ -54,6 +54,7 @@ export function LoginModal() { const [isLoading, setIsLoading] = useState(false); const [isSendingCode, setIsSendingCode] = useState(false); const [error, setError] = useState(""); + const [agreementChecked, setAgreementChecked] = useState(false); const [captchaOpen, setCaptchaOpen] = useState(false); const [captchaId, setCaptchaId] = useState(""); @@ -399,7 +400,8 @@ export function LoginModal() { isLoading || mode === "wechat" || !phone.trim() || - (mode === "password" ? !password : !code.trim()); + (mode === "password" ? !password : !code.trim()) || + !agreementChecked; const isWxBindSubmitDisabled = isLoading || !wxRegisterToken || !wxBindPhone.trim() || !wxBindCode.trim(); @@ -501,6 +503,26 @@ export function LoginModal() { +

+ 登录即代表同意 + + 《用户协议》 + + 和 + + 《隐私政策》 + +

) ) : ( @@ -562,6 +584,31 @@ export function LoginModal() { > {mode === "password" ? t("auth.login") : t("auth.loginOrRegister")} + setAgreementChecked(event.target.checked)} + className="text-xs leading-5 text-neutral-500" + > + 登录即代表同意 + + 《用户协议》 + + 和 + + 《隐私政策》 + + ,未注册手机号将自动注册 + )}