优化files路由文件,适配新版next.js
This commit is contained in:
parent
bf89dabe3a
commit
26e373f736
@ -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 });
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user