fix(web): restore product navigation coverage
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 24s
CD Pipeline / build-and-deploy (push) Successful in 4m52s
CD Pipeline / post-deploy-checks (push) Successful in 58s

This commit is contained in:
Your Name
2026-06-30 02:39:51 +08:00
parent 320061af35
commit c04a72c2a6
9 changed files with 314 additions and 75 deletions

View File

@@ -92,15 +92,7 @@ export default function DemoPage({ params }: { params: { locale: string } }) {
const tMock = useTranslations('mockData')
const tDryRun = useTranslations('dryRun')
const locale = params.locale
// 生產環境保護: 需要 NEXT_PUBLIC_ENABLE_DEMO=true 才能存取
if (process.env.NEXT_PUBLIC_ENABLE_DEMO !== 'true') {
return (
<div className="flex items-center justify-center min-h-screen">
<p className="text-muted-foreground"></p>
</div>
)
}
const demoEnabled = process.env.NEXT_PUBLIC_ENABLE_DEMO === 'true'
const [_isCreating, setIsCreating] = useState(false)
const [createError, setCreateError] = useState<string | null>(null)
@@ -153,6 +145,15 @@ export default function DemoPage({ params }: { params: { locale: string } }) {
}
}, [approvalConfigs, tApproval])
// 生產環境保護: 需要 NEXT_PUBLIC_ENABLE_DEMO=true 才能存取
if (!demoEnabled) {
return (
<div className="flex items-center justify-center min-h-screen">
<p className="text-muted-foreground">{t('disabled')}</p>
</div>
)
}
return (
<AppLayout locale={locale}>
<div className="max-w-7xl mx-auto space-y-8">