From 12768a890bac29373e9b01551e8d6f00c0f2f072 Mon Sep 17 00:00:00 2001 From: Developer Date: Wed, 18 Mar 2026 11:36:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E6=A0=8F=E9=AB=98=E5=BA=A6=E5=92=8C=E5=9E=82=E7=9B=B4=E5=B1=85?= =?UTF-8?q?=E4=B8=AD=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整 AppShell header 高度为 56px 并添加内联样式强制垂直居中 - 优化月份选择器按钮大小为 36px - 更新 SPEC.md 添加端口配置说明 (前端 3500, 后端 3501) Co-Authored-By: Claude Opus 4.6 --- SPEC.md | 28 +++++++++++++++++++++++--- frontend/components/AppShell.js | 2 +- frontend/styles/globals.css | 35 +++++++++++++++++++++------------ 3 files changed, 48 insertions(+), 17 deletions(-) diff --git a/SPEC.md b/SPEC.md index c76c512..858b046 100644 --- a/SPEC.md +++ b/SPEC.md @@ -11,9 +11,17 @@ - **后端**: Node.js + Express - **数据库**: SQLite (轻量级,无需额外安装) -- **前端**: 原生 HTML/CSS/JavaScript (保持简单) +- **前端**: Next.js 14 (React) - **认证**: JWT Token -- **端口**: 3500 + +## 2.1 端口配置 + +| 服务 | 端口 | 启动命令 | +|------|------|----------| +| 前端 (Next.js) | 3500 | `cd frontend && npm run dev` | +| 后端 (Express API) | 3501 | `node server.js` | + +> **注意**: 前端通过 Next.js 开发服务器的 API 代理访问后端,代理配置在 `frontend/next.config.js` 中 ## 3. UI/UX 规范 @@ -180,4 +188,18 @@ CREATE TABLE records ( 4. ✅ 可以新增收入/支出记录 5. ✅ 可以编辑和删除记录 6. ✅ 移动端界面正常显示和操作 -7. ✅ 通过 ip:3500 访问 +7. ✅ 通过 http://localhost:3500 访问前端 + +## 8. 快速启动 + +```bash +# 启动后端 (端口 3501) +cd /opt/accountbook +node server.js + +# 启动前端 (端口 3500) +cd /opt/accountbook/frontend +npm run dev +``` + +访问 http://你的IP:3500 diff --git a/frontend/components/AppShell.js b/frontend/components/AppShell.js index b7b876e..a129d56 100644 --- a/frontend/components/AppShell.js +++ b/frontend/components/AppShell.js @@ -33,7 +33,7 @@ export default function AppShell({ title, subtitle, actions, headerContent, chil return (
-
+
{headerNode ?
{headerNode}
: