From 2c0a5379e7ffe9f0997113bae4741cd2c693c726 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 23 Feb 2026 12:12:15 +0800 Subject: [PATCH] fix: show register entry in new login dialog --- components/home/lovart-home.tsx | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) 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({

欢迎来到 {siteName}

-

登录或注册以继续

+

+ {canUseRegistration ? "登录或注册以继续" : "登录以继续"} +

{hasThirdPartyLoginOptions ? ( @@ -2029,6 +2042,19 @@ export function LovartHome({ + {canUseRegistration ? ( +
+ 还没有账号? + +
+ ) : null} +

继续即表示您同意使用条款和隐私政策