From e3285f0961b2b1f5f35538275eef2f9fbdcf3a7a Mon Sep 17 00:00:00 2001 From: Hera Zhao Date: Thu, 9 Apr 2026 10:12:53 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9C=AA=E7=99=BB=E5=BD=95=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=AF=8F=E6=AC=A1=E6=8F=90=E7=A4=BA=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?QR=EF=BC=8C=E5=B7=B2=E7=99=BB=E5=BD=95=E6=AF=8F=E6=9C=88?= =?UTF-8?q?=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/components/RecipeDetailOverlay.vue | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/RecipeDetailOverlay.vue b/frontend/src/components/RecipeDetailOverlay.vue index 4a6b9b6..38a560e 100644 --- a/frontend/src/components/RecipeDetailOverlay.vue +++ b/frontend/src/components/RecipeDetailOverlay.vue @@ -516,12 +516,19 @@ async function loadBrand() { } catch { brand.value = {} } - // Prompt QR upload at most once per month + // Prompt QR upload: logged-in users once per month, anonymous every time if (showBrandHint.value) { - const lastPrompt = localStorage.getItem('qr_upload_prompt_time') - const oneMonth = 30 * 24 * 60 * 60 * 1000 - if (!lastPrompt || Date.now() - Number(lastPrompt) > oneMonth) { - localStorage.setItem('qr_upload_prompt_time', String(Date.now())) + let shouldPrompt = true + if (authStore.isLoggedIn) { + const lastPrompt = localStorage.getItem('qr_upload_prompt_time') + const oneMonth = 30 * 24 * 60 * 60 * 1000 + if (lastPrompt && Date.now() - Number(lastPrompt) < oneMonth) { + shouldPrompt = false + } else { + localStorage.setItem('qr_upload_prompt_time', String(Date.now())) + } + } + if (shouldPrompt) { const ok = await showConfirm( '上传你的专属二维码,让配方卡片更专业 ✨', { okText: '去上传', cancelText: '下次再说' }