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:
@@ -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)
|
||||
|
||||
// 从数据库查询章节
|
||||
|
||||
Reference in New Issue
Block a user