fix: 修复章节API的Next.js 16兼容性问题

- 更新chapter/[id]/route.ts使用Promise params (Next.js 16要求)
- 删除过时的app/api/db目录下的旧API文件(bookDB/userDB等不存在的导出)
- 添加部署脚本deploy-to-server.sh
- 添加章节迁移脚本migrate-chapters-to-db.ts
This commit is contained in:
卡若
2026-01-25 10:36:30 +08:00
parent 263da246c9
commit 153b8d9795
11 changed files with 300 additions and 656 deletions

View File

@@ -10,10 +10,10 @@ const FREE_CHAPTERS = ['preface', 'epilogue', '1.1', 'appendix-1', 'appendix-2',
export async function GET(
req: NextRequest,
{ params }: { params: { id: string } }
{ params }: { params: Promise<{ id: string }> }
) {
try {
const chapterId = params.id
const { id: chapterId } = await params
console.log('[Chapter API] 请求章节:', chapterId)
// 从数据库查询章节