将config.ts中的部分配置移动到.env中,方便私有部署。

将public中的psd文件移出,防止被打包到dist。
判断TURNSTILE_SITE_KEY为空时不开启此功能。
This commit is contained in:
MoeGrid
2025-03-16 19:56:14 +08:00
committed by Azalea
parent a076d50cb3
commit 3ac6d79644
10 changed files with 23 additions and 9 deletions

View File

@@ -51,7 +51,7 @@
return submitting = false
}
if (turnstile === "") {
if (TURNSTILE_SITE_KEY && turnstile === "") {
// Sleep for 100ms to allow Turnstile to finish
error = t("welcome.waiting-turnstile")
return setTimeout(submit, 100)
@@ -137,11 +137,13 @@
{isSignup ? t('welcome.btn-signup') : t('welcome.btn-login')}
{/if}
</button>
{#if TURNSTILE_SITE_KEY}
<Turnstile siteKey={TURNSTILE_SITE_KEY} bind:reset={turnstileReset}
on:turnstile-callback={e => console.log(turnstile = e.detail.token)}
on:turnstile-error={_ => console.log(error = t("welcome.turnstile-error"))}
on:turnstile-expired={_ => window.location.reload()}
on:turnstile-timeout={_ => console.log(error = t('welcome.turnstile-timeout'))} />
{/if}
</div>
{:else if state === "verify"}
<div class="login-form" transition:slide>