fix(qa): 第五轮系统性质量保障缺陷修复 + 单元/集成测试

安全/鉴权:登出清服务端 httpOnly 令牌、登录 IP 限流前置 bcrypt、停用账号
令牌在 6 个内联 role handler 失效、admin/items 存在性 oracle 认证前置、
同意偏好 sanitize fail-closed、api-crypto 按 HTTP 方法判体。

CMS:workflow 状态更新+审计收进交互式 $transaction(失败即回滚)、编辑器
richtext 走 textarea 防换行损毁、array/object 子字段按作用域读写防污染、
about/contact/erp-upgrade 补 ISR revalidate 与路由映射。

UI/a11y:AnimatedCounter 入视口前显起点、CLS 累计上报、MetricCard 动画入
effect 并卸载取消 rAF、后台状态四态映射/搜索防抖+序号守卫/媒体单 input/
吞错改横幅/表单 label-aria 关联。

新增对应判别性单测与 pagination/rate-limit/client-ip/sanitize/validate-content-data
等模块及 tests-integration 真库集成层。
This commit is contained in:
zhangxiang committed 2026-09-28 10:48:07 +08:00
1 parent 040951c0a3
commit a366bd1400
224 files changed
+8938 -5579

No files matched your search

+76
View File
@@ -0,0 +1,76 @@
'use client';
// 根布局抛错时 Next.js 用内置文档顶替 root layout,而内置文档的 <html> 没有 lang、
// 也不读本站的 html[data-theme] 令牌,深色下会落到浏览器默认画布(实测 #0A0E14 令牌失效、
// bgMatchesToken=false,axe 报 html-has-lang)。全站 axe 扫描扩到预渲染产物后暴露此缺口。
// 因此这里自带文档壳 + 与 globals.css 同值的 OS 主题样式,不依赖 root layout。
export default function GlobalError({
error,
retry,
}: {
error: Error & { digest?: string };
retry: () => void;
}) {
return (
<html lang="zh-CN">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>页面无法显示 | 四川睿新致远科技有限公司</title>
<style>{`
:root { color-scheme: light; }
body { margin: 0; background: #FFFFFF; color: #0A0E14;
font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
@media (prefers-color-scheme: dark) {
:root { color-scheme: dark; }
body { background: #0A0E14; color: #F8FAFC; }
}
`}</style>
</head>
<body>
<main style={{ maxWidth: 640, margin: '0 auto', padding: '96px 24px', textAlign: 'center' }}>
<h1 style={{ fontSize: 28, fontWeight: 700, margin: '0 0 16px' }}>应用暂时无法显示此页面</h1>
<p style={{ fontSize: 16, lineHeight: 1.7, margin: '0 0 8px' }}>
渲染过程中出现错误,我们已记录该问题。请重试,或返回首页继续浏览。
</p>
{error.digest ? (
<p style={{ fontSize: 13, margin: '0 0 24px' }}>错误编号:{error.digest}</p>
) : (
<p style={{ fontSize: 13, margin: '0 0 24px' }}>请稍后重试</p>
)}
<div style={{ display: 'flex', gap: 12, justifyContent: 'center' }}>
<button
type="button"
onClick={() => retry()}
style={{
fontSize: 15,
fontWeight: 600,
padding: '10px 20px',
border: '1px solid currentColor',
background: 'transparent',
color: 'inherit',
cursor: 'pointer',
}}
>
重试
</button>
<a
href="/"
style={{
fontSize: 15,
fontWeight: 600,
padding: '10px 20px',
border: '1px solid currentColor',
background: 'transparent',
color: 'inherit',
textDecoration: 'none',
}}
>
返回首页
</a>
</div>
</main>
</body>
</html>
);
}