|
@@ -1,4 +1,5 @@
|
|
|
import { writeFile } from "fs/promises";
|
|
|
+import { chmod } from "fs/promises";
|
|
|
import { NextResponse } from "next/server";
|
|
|
import path from "path";
|
|
|
import { setCORSHeaders } from "../../lib/apiUtils";
|
|
@@ -25,6 +26,9 @@ export async function POST(request) {
|
|
|
|
|
|
await writeFile(filepath, buffer);
|
|
|
|
|
|
+ // 设置文件权限为 0755 (rwxr-xr-x)
|
|
|
+ await chmod(filepath, 0o755);
|
|
|
+
|
|
|
const response = NextResponse.json({
|
|
|
success: true,
|
|
|
filename,
|