|
|
|
@ -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() { |
|
|
|
<Button onClick={() => void loadWxQrCode()} loading={wxQrLoading}> |
|
|
|
{t("auth.wechatReloadQr")} |
|
|
|
</Button> |
|
|
|
<p className="text-center text-xs leading-5 text-neutral-500"> |
|
|
|
登录即代表同意 |
|
|
|
<a |
|
|
|
href="https://www.popi.art/content/userTerms" |
|
|
|
target="_blank" |
|
|
|
rel="noreferrer" |
|
|
|
className="text-blue-500 hover:underline" |
|
|
|
> |
|
|
|
《用户协议》 |
|
|
|
</a> |
|
|
|
和 |
|
|
|
<a |
|
|
|
href="https://www.popi.art/content/privacyPolicy" |
|
|
|
target="_blank" |
|
|
|
rel="noreferrer" |
|
|
|
className="text-blue-500 hover:underline" |
|
|
|
> |
|
|
|
《隐私政策》 |
|
|
|
</a> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
) |
|
|
|
) : ( |
|
|
|
@ -562,6 +584,31 @@ export function LoginModal() { |
|
|
|
> |
|
|
|
{mode === "password" ? t("auth.login") : t("auth.loginOrRegister")} |
|
|
|
</Button> |
|
|
|
<Checkbox |
|
|
|
checked={agreementChecked} |
|
|
|
onChange={(event) => setAgreementChecked(event.target.checked)} |
|
|
|
className="text-xs leading-5 text-neutral-500" |
|
|
|
> |
|
|
|
登录即代表同意 |
|
|
|
<a |
|
|
|
href="https://www.popi.art/content/userTerms" |
|
|
|
target="_blank" |
|
|
|
rel="noreferrer" |
|
|
|
className="text-blue-500 hover:underline" |
|
|
|
> |
|
|
|
《用户协议》 |
|
|
|
</a> |
|
|
|
和 |
|
|
|
<a |
|
|
|
href="https://www.popi.art/content/privacyPolicy" |
|
|
|
target="_blank" |
|
|
|
rel="noreferrer" |
|
|
|
className="text-blue-500 hover:underline" |
|
|
|
> |
|
|
|
《隐私政策》 |
|
|
|
</a> |
|
|
|
,未注册手机号将自动注册 |
|
|
|
</Checkbox> |
|
|
|
</> |
|
|
|
)} |
|
|
|
</div> |
|
|
|
|