From 897899305f8142153926120538a7df16b2120d8c Mon Sep 17 00:00:00 2001 From: opsx Date: Sun, 1 Nov 2026 05:59:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(license):=20=E8=AF=95=E7=94=A8=E6=80=81?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E3=80=8C=E9=80=80=E5=87=BA=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E3=80=8D=E2=80=94=E2=80=94=E8=AF=95=E7=94=A8=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E6=8E=88=E6=9D=83,=E7=82=B9=E4=BA=86=E5=BF=85=E6=8A=A5'?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E6=9C=AA=E6=BF=80=E6=B4=BB'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit canDeactivate 改为:有正式授权(plan=pro 且非 trial)且 admin 才显示; 试用态(库内无码)显示试用提示条而非退出按钮(实测复现:试用态点击退出 toast 报'当前未激活授权',按钮又因 pro=true 未消失,看似'点击没反应') --- frontend/src/pages/settings/components/LicenseSection.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/settings/components/LicenseSection.tsx b/frontend/src/pages/settings/components/LicenseSection.tsx index 45d14ac..d80ff52 100644 --- a/frontend/src/pages/settings/components/LicenseSection.tsx +++ b/frontend/src/pages/settings/components/LicenseSection.tsx @@ -19,7 +19,9 @@ export const LicenseSection = memo(function LicenseSection() { const { t } = useTranslation('license') const { pro, info, reload } = useLicense() const isAdmin = getUser()?.role === 'admin' - const canDeactivate = Boolean(pro) && isAdmin + // 退出授权只对已激活的正式授权有意义;试用态(库内无码)点了必然报"未激活",隐藏按钮 + const hasFormalLicense = Boolean(info && info.plan === 'pro' && !info.trial?.active) + const canDeactivate = hasFormalLicense && isAdmin const [key, setKey] = useState('') const [activating, setActivating] = useState(false) const [confirmOpen, setConfirmOpen] = useState(false)