ed257fe4e6
- migrate: 校验已应用 migration 的 SHA-256,拒绝 schema drift; split 后 trim + skip empty,避免空 statement 触发 SQL 错误 - todo.contract: update 拒绝空 patch - env: DATABASE_URL 限定 postgres(ql):// scheme,配置错误更早失败 - compile: autoloadDotenv: false,二进制部署不再吞 cwd 的 .env - Error.tsx: 生产环境隐藏 error.message,避免内部错误泄露 - AGENTS: 同步 generatedFieldKeys / migrator 行为新描述
41 lines
1.5 KiB
TypeScript
41 lines
1.5 KiB
TypeScript
export const ErrorComponent = ({ error, reset }: { error: Error; reset: () => void }) => {
|
|
return (
|
|
<div className="min-h-screen flex items-center justify-center bg-slate-50 px-4">
|
|
<div className="max-w-md w-full text-center space-y-6">
|
|
<div className="inline-flex items-center justify-center w-16 h-16 rounded-full bg-red-100">
|
|
<svg
|
|
className="w-8 h-8 text-red-500"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke="currentColor"
|
|
strokeWidth={1.5}
|
|
aria-hidden="true"
|
|
>
|
|
<path
|
|
strokeLinecap="round"
|
|
strokeLinejoin="round"
|
|
d="M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div>
|
|
<h1 className="text-2xl font-bold text-slate-900">出错了</h1>
|
|
<p className="text-slate-500 mt-2">{import.meta.env.DEV ? error.message : '请求失败,请稍后重试'}</p>
|
|
</div>
|
|
<div className="flex items-center justify-center gap-4">
|
|
<button
|
|
type="button"
|
|
onClick={reset}
|
|
className="px-6 py-2.5 bg-indigo-600 hover:bg-indigo-700 text-white rounded-xl font-medium transition-colors"
|
|
>
|
|
重试
|
|
</button>
|
|
<a href="/" className="px-6 py-2.5 text-slate-600 hover:text-slate-900 font-medium transition-colors">
|
|
返回首页
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|