From e84af70b76fc46e65cf80556eef3a286fd03d094 Mon Sep 17 00:00:00 2001 From: huangmin <2927933426@qq.com> Date: Tue, 2 Jun 2026 12:32:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E5=92=8C=E9=9A=90=E7=A7=81=E6=94=BF=E7=AD=96?= =?UTF-8?q?=E7=9A=84=E5=90=8C=E6=84=8F=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/auth/LoginModal.tsx | 51 ++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) 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" + > + 登录即代表同意 + + 《用户协议》 + + 和 + + 《隐私政策》 + + ,未注册手机号将自动注册 + )}