From 3e02f2c7a28452d0baf8e2c88365e065be90b5ac Mon Sep 17 00:00:00 2001 From: Claude Code Date: Sun, 29 Mar 2026 04:14:01 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20server.js=20URL=20?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=EF=BC=8C=E6=94=AF=E6=8C=81=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 server.js 第48行,使用 req.url.split('?')[0] 剥离查询参数 - 修复 view-doc.html?doc=xxx 无法访问的问题 - 更新文档链接从模态框改为独立页面展示 - 前端 Markdown 渲染,不使用后端 API Co-Authored-By: Claude Sonnet 4.6 --- prototype/docs-index.html | 53 +----- prototype/index.html | 59 +------ prototype/server.js | 2 +- prototype/view-doc.html | 329 ++++++++++++++++++++++++++++++-------- 4 files changed, 266 insertions(+), 177 deletions(-) diff --git a/prototype/docs-index.html b/prototype/docs-index.html index 593fdb2..2efd00e 100644 --- a/prototype/docs-index.html +++ b/prototype/docs-index.html @@ -23,16 +23,6 @@ .stat-item { background: linear-gradient(135deg, var(--primary-blue), #40a9ff); } - .doc-content { - margin-top: 1rem; - padding: 2rem; - background: white; - border-radius: 0.5rem; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); - } - .doc-content.hidden { - display: none; - } .markdown-body h1, .markdown-body h2 { border-bottom: 1px solid #e5e7eb; padding-bottom: 0.5em; margin-bottom: 1em; } .markdown-body pre { background: #1f2937; color: #e5e7eb; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; } .markdown-body code { background: #f3f4f6; padding: 0.2em 0.4em; border-radius: 0.25rem; } @@ -155,11 +145,10 @@ 技术架构 数据模型 - + 查看文档 - @@ -202,11 +191,10 @@ 色彩系统 无障碍 - + 查看文档 - @@ -249,11 +237,10 @@ 任务制定 AI抽背 - + 查看文档 - @@ -338,39 +325,5 @@ - diff --git a/prototype/index.html b/prototype/index.html index ebb7b17..694f2b0 100644 --- a/prototype/index.html +++ b/prototype/index.html @@ -295,10 +295,10 @@ 基于 PRD 和 UX 设计规范自动生成 | 2026-03-28 @@ -306,60 +306,5 @@ - - - - - - - diff --git a/prototype/server.js b/prototype/server.js index a54e800..0f65b96 100644 --- a/prototype/server.js +++ b/prototype/server.js @@ -45,7 +45,7 @@ const MIME_TYPES = { // 创建服务器 const server = http.createServer((req, res) => { // 解析 URL - let urlPath = req.url; + let urlPath = req.url.split('?')[0] || '/'; // 处理根路径 if (urlPath === '/') { diff --git a/prototype/view-doc.html b/prototype/view-doc.html index 45db797..f6dd822 100644 --- a/prototype/view-doc.html +++ b/prototype/view-doc.html @@ -8,93 +8,284 @@ + -
-
+ + +
+ +
+
+
+ +
-