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