优化files路由文件,适配新版next.js

This commit is contained in:
jingrow 2026-01-22 22:47:32 +08:00
parent bf89dabe3a
commit 26e373f736

View File

@ -30,7 +30,8 @@ function getContentType(filePath) {
export async function GET(req, { params }) { export async function GET(req, { params }) {
try { try {
const parts = params.path || []; const resolvedParams = await params;
const parts = resolvedParams.path || [];
const fileName = parts.join('/'); const fileName = parts.join('/');
if (!fileName) return new NextResponse('Not Found', { status: 404 }); if (!fileName) return new NextResponse('Not Found', { status: 404 });