safesight-control/docs/bugfix-record.md

14 lines
917 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Bug 修复记录
## 2026-07-26视频源中文名删除失败
**现象**:视频源用中文名时,删除提示"视频源已删除"但刷新后仍在列表。
**根因**`chi.URLParam("name")` 对中文路径返回 URL 编码值(如 `%e6%9d%8e%e5%9b%9b`),而非解码后的文本(`李四`。SQL `DELETE WHERE name = '%e6%9d%8e%e5%9b%9b'` 匹配不到实际行,静默失败。
**修复**:删除改用整数 ID`/assets/video-sources/{id}/delete`),彻底避免 URL 编码问题。同时为服务和存储层添加 `DeleteVideoSourceByID(id)` 方法。
**影响范围**:视频源页面新建、编辑、改名、删除均使用 ID 做主键,不再依赖 name 作为标识符。
**教训**URL 路径中的中文参数应避免使用,优先用整数 ID 或 query stringchi 会正确解码 query string。如需修改其他资产页面的删除逻辑同样使用 ID。