From a72f228f7d2b316e4f7c6f31af64f9f6a162280a Mon Sep 17 00:00:00 2001 From: qian Date: Thu, 24 Sep 2026 01:11:14 +0800 Subject: [PATCH] =?UTF-8?q?refactor(ui):=E7=A7=BB=E9=99=A4=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E8=B4=A6=E5=8F=B7=E6=97=B6=E7=9A=84=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/tenant/src/views/auth/RegisterPage.vue | 32 +++++++--------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/web/tenant/src/views/auth/RegisterPage.vue b/web/tenant/src/views/auth/RegisterPage.vue index e4a860c..b69eb2b 100644 --- a/web/tenant/src/views/auth/RegisterPage.vue +++ b/web/tenant/src/views/auth/RegisterPage.vue @@ -61,20 +61,15 @@ function formatReset(seconds: number): string { return `约 ${Math.ceil(seconds / 3600)} 小时` } -const rateLimitNotice = computed<{ type: 'blocked' | 'info'; text: string } | null>(() => { +// 仅在注册被限流(次数耗尽)时提示,平时不展示剩余次数 +const rateLimitNotice = computed(() => { const s = rateLimit.value if (!s) return null if (s.daily_limit > 0 && s.daily_remaining <= 0) { - return { type: 'blocked', text: `今日注册次数已达上限(每日 ${s.daily_limit} 次),${formatReset(s.daily_reset_seconds)}后重置` } + return `今日注册次数已达上限(每日 ${s.daily_limit} 次),${formatReset(s.daily_reset_seconds)}后重置` } if (s.hourly_limit > 0 && s.hourly_remaining <= 0) { - return { type: 'blocked', text: `注册已达每小时上限(${s.hourly_limit} 次/小时),${formatReset(s.hourly_reset_seconds)}后重置` } - } - if (s.hourly_limit > 0 || s.daily_limit > 0) { - const parts: string[] = [] - if (s.hourly_limit > 0) parts.push(`本小时 ${s.hourly_remaining}/${s.hourly_limit} 次`) - if (s.daily_limit > 0) parts.push(`今日 ${s.daily_remaining}/${s.daily_limit} 次`) - return { type: 'info', text: `剩余注册次数:${parts.join(',')}` } + return `注册已达每小时上限(${s.hourly_limit} 次/小时),${formatReset(s.hourly_reset_seconds)}后重置` } return null }) @@ -218,7 +213,7 @@ async function handleRegister() { proceedAfterRegister() } catch (err: any) { captchaRef.value?.resetCaptcha() - // 本次尝试已消耗限流计数,刷新剩余次数提示 + // 本次尝试已消耗限流计数,刷新限流状态 fetchRateLimit() const apiErr = extractApiError(err) const msg = apiErr?.message || '注册失败' @@ -261,20 +256,13 @@ async function handleRegister() {

几分钟即可开始使用,团队功能可后续开启

- +
- - {{ rateLimitNotice.text }} + + {{ rateLimitNotice }}
@@ -382,7 +370,7 @@ async function handleRegister() { -