包含: - furniture-3d-system:Next.js 16 全栈应用(资产中心、产品管理、3D装配动画) - autocad-plugin:AutoCAD 家具导出插件源码 - 资产中心改造:编辑弹窗化、删除功能、Toast反馈、自定义Select组件 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.2 KiB
1.2 KiB
title, date, module, problem_type, severity, symptoms, root_cause, resolution_type, status, confidence, tags, related_patterns
| title | date | module | problem_type | severity | symptoms | root_cause | resolution_type | status | confidence | tags | related_patterns | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 产品板件路由权限收口到 Service | 2026-02-15 | panel-route | workflow_issue | high |
|
分层迁移不彻底,Controller 仍承担数据访问与业务判断 | code_fix | active | high |
|
|
现象与影响
products/[id]/panels 在 Route 层重复做查询和权限,Service 也有权限逻辑,导致规则双轨并行。
修复动作
src/app/api/products/[id]/panels/route.ts移除 Prisma 和canView/canEdit分支。src/server/services/panel.service.ts的findByProductId接入权限校验(ctx.user存在时执行canViewProduct)。- Route 仅保留参数解析、调用 Service 与统一响应。
验证
npm run type-check -- --pretty false通过npm test -- tests/api/auth-me.test.ts --runInBand通过
预防策略
- Route 层只做入口编排;权限与业务判断统一放在 Service 层,避免策略漂移。