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

+32
View File
@@ -0,0 +1,32 @@
import * as Sentry from '@sentry/nextjs';
/**
* Next.js 服务端 instrumentation 入口(Next 16 文件约定:根目录或 src/ 下,本仓库使用 src/)。
* 依据(本仓库自带官方文档):
* - node_modules/next/dist/docs/01-app/02-guides/instrumentation.md
* (register() 在每个服务器实例启动时调用一次;按 NEXT_RUNTIME 条件导入 runtime 专属代码)
* - node_modules/next/dist/docs/01-app/03-api-reference/03-file-conventions/instrumentation.md
* (可选导出 onRequestError,用于把服务端错误转发给 observability provider)
*
* Sentry v10 的接线要求(佐证来自已安装版本源码,非记忆):
* - instrumentation 文件必须存在且包含 onRequestError 钩子,否则 SDK 判定为过期配置:
* node_modules/@sentry/nextjs/build/esm/config/webpack.js:305-317
* - instrumentation 文件引用 sentry.server/edge.config 即视为受支持的初始化位置:
* node_modules/@sentry/nextjs/build/esm/config/webpack.js:320-331(warnAboutDeprecatedConfigFiles)
* - captureRequestError 由 @sentry/nextjs 顶层导出:
* node_modules/@sentry/nextjs/build/types/index.types.d.ts(export { captureRequestError } from './common/captureRequestError')
*
* 无 DSN 时行为与 GoogleAnalytics.tsx 的门禁一致:sentry.*.config 内部读到空 DSN 即跳过
* Sentry.init,SDK 不发送任何请求(见 sentry.server.config.ts / sentry.edge.config.ts 的 if (SENTRY_DSN) 分支)。
*/
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
await import('../sentry.server.config');
}
if (process.env.NEXT_RUNTIME === 'edge') {
await import('../sentry.edge.config');
}
}
export const onRequestError = Sentry.captureRequestError;