diff --git a/components/home/lovart-home.tsx b/components/home/lovart-home.tsx index bb432904a..55604464c 100644 --- a/components/home/lovart-home.tsx +++ b/components/home/lovart-home.tsx @@ -129,6 +129,7 @@ type PublicAuthSettings = { isDingTalkEnabled?: boolean; isGoogleEnabled?: boolean; isGoogleConfigured?: boolean; + isRegistrationEnabled?: boolean; }; type ContactConfig = { @@ -643,6 +644,7 @@ export function LovartHome({ authSettingsData?.isGoogleEnabled && authSettingsData?.isGoogleConfigured ); const canUseDingTalkLogin = Boolean(authSettingsData?.isDingTalkEnabled); + const canUseRegistration = authSettingsData?.isRegistrationEnabled !== false; const hasThirdPartyLoginOptions = canUseGoogleLogin || canUseDingTalkLogin; const handleLogout = async () => { @@ -892,6 +894,15 @@ export function LovartHome({ window.location.href = "/api/auth/dingtalk/login"; }; + const handleRegister = () => { + if (!canUseRegistration) { + toast.error("当前未开放注册"); + return; + } + setLoginDialogOpen(false); + router.push("/register"); + }; + const handleOpenImageEditor = () => { if (!isAuthenticated) { openLoginDialog(); @@ -1959,7 +1970,9 @@ export function LovartHome({
登录或注册以继续
++ {canUseRegistration ? "登录或注册以继续" : "登录以继续"} +
继续即表示您同意使用条款和隐私政策