From 3a1f0a0b19b748690b0bcb5df7cd60e92cc1fc26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Tue, 15 Sep 2026 17:38:09 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20v-html=20=E7=BA=A2=E7=BA=BF=E7=BB=86?= =?UTF-8?q?=E5=8C=96=EF=BC=88=E4=B8=9A=E5=8A=A1=E4=BB=A3=E7=A0=81=E7=A6=81?= =?UTF-8?q?=E7=94=A8+=E6=A8=A1=E6=9D=BF=E7=BB=84=E4=BB=B6=E4=B8=8D?= =?UTF-8?q?=E5=96=82=E8=AE=BF=E5=AE=A2=E6=95=B0=E6=8D=AE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Code --- .../plans/2026-09-15-m1-data-collection-foundation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/superpowers/plans/2026-09-15-m1-data-collection-foundation.md b/docs/superpowers/plans/2026-09-15-m1-data-collection-foundation.md index 88e8f1b..73fa894 100644 --- a/docs/superpowers/plans/2026-09-15-m1-data-collection-foundation.md +++ b/docs/superpowers/plans/2026-09-15-m1-data-collection-foundation.md @@ -57,7 +57,7 @@ cms-cj/ - **响应包**:所有 `/api/admin/*` 返回 `{code: 200, data: ..., message: "ok"}`(适配 Art Design Pro 拦截器默认约定);错误 `code` 为业务码(401 未登录/403 无权/4xx 参数/500 内部)。 - **时间**:全库 UTC 存储(`USE_TZ=True`),展示层按 `settings.TIME_ZONE='Asia/Shanghai'`。 - **采集跨域**:SDK 用 `Content-Type: text/plain` 发 JSON(简单请求免预检),服务端用 `PlainJSONParser` 解析;`django-cors-headers` + 动态白名单(DB 中 Site.domain_whitelist,60s 缓存)回 `Access-Control-Allow-Origin`。 -- **前端安全红线**:全项目禁用 `v-html`;访客来源数据(path/title/referrer/utm)不得直接绑定 `href/src`——如需渲染成链接,协议白名单仅 http/https(Vue 不拦截 `javascript:` URI)。 +- **前端安全红线**:**业务代码(views/tracker/**、api/**)禁用 v-html**;不得向模板内置 v-html 组件(ArtTextScroll/ThemeSvg/v-highlight)传访客来源数据;访客来源数据(path/title/referrer/utm)不得直接绑定 `href/src`——如需渲染成链接,协议白名单仅 http/https(Vue 不拦截 `javascript:` URI)。前端适配约定见 `admin/README-dev.md`(config-object 签名/URL 无 /api 前缀/Bearer 不手拼)。 - **测试**:后端 `pytest`(SQLite 内存库,`pytest.ini` 指定 `--ds=config.settings_test`);SDK `vitest` + happy-dom + fake timers。 - **提交**:每任务一提交,`feat:/test:/chore:` 前缀。 - **M1 明确不做**(防执行者自作主张加码):SPA 路由、点击/滚动/表单/意图事件、客户(contact)体系、Redis、事件表分区迁移、npm 发布。