diff --git a/README.md b/README.md index 080df27..844cdef 100644 --- a/README.md +++ b/README.md @@ -130,3 +130,5 @@ pnpm start:prod - `DEEPSEEK_API_KEY` 仅在业务后端配置,前端不读取、不保存。 标签页图标采用 `public/stellar-icon-v2.svg`,同时提供多尺寸 `favicon.ico`、180/192/512 PNG,覆盖浏览器、Apple 主屏幕和 PWA。版本化资源路径用于刷新旧图标缓存。 + +通用实验消费者可经 `GET /api/digital/decisions/:key` 读取本人类型决策的 `data.value`,沿用 HttpOnly 会话与不缓存策略。类型、测试方案和用户分组全部在后台管理;新类型需要应用真实使用返回值并完成后台接入验收后才可启动。 diff --git a/src/app/api/digital/[...path]/route.ts b/src/app/api/digital/[...path]/route.ts index 348a79f..107d9df 100644 --- a/src/app/api/digital/[...path]/route.ts +++ b/src/app/api/digital/[...path]/route.ts @@ -33,11 +33,13 @@ async function proxy( const { path } = await context.params; const joined = path.join("/"); if ( - !/^(bootstrap|profile|exposure|conversations(?:\/[a-zA-Z0-9_-]+(?:\/(?:stream|stop|branch|messages\/[a-zA-Z0-9_-]+))?)?)$/.test( + !/^(bootstrap|profile|exposure|decisions\/[a-zA-Z0-9_-]+|conversations(?:\/[a-zA-Z0-9_-]+(?:\/(?:stream|stop|branch|messages\/[a-zA-Z0-9_-]+))?)?)$/.test( joined, ) ) return Response.json({ message: "接口不存在" }, { status: 404 }); + if (joined.startsWith("decisions/") && request.method !== "GET") + return Response.json({ message: "仅支持读取决策" }, {status:405,headers:{Allow:"GET"}}); if (request.method !== "GET") { const origin = request.headers.get("origin"); try {