fix: image upload proxy, compression, and JSON parse safety
- Add /api/v1/ and /files/ rewrite rules in next.config.ts so frontend can call backend without /admin139 prefix - Fix upload using MultiPartParser instead of req->getUploadedFiles() - Add client-side image compression (canvas resize to 1920px, quality 0.8) for photos >500KB before upload - Safe JSON parsing: catch HTML error responses instead of throwing SyntaxError on non-JSON backend responses - Fix backslash escape in delete filename validation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
这个提交包含在:
@@ -18,6 +18,16 @@ const nextConfig: NextConfig = {
|
||||
source: "/admin139/:path+",
|
||||
destination: `${backendInternal}/:path*`,
|
||||
},
|
||||
{
|
||||
// Proxy backend API calls made without /admin139 prefix
|
||||
source: "/api/v1/:path*",
|
||||
destination: `${backendInternal}/api/v1/:path*`,
|
||||
},
|
||||
{
|
||||
// Proxy backend static files (note images etc.)
|
||||
source: "/files/:path*",
|
||||
destination: `${backendInternal}/files/:path*`,
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
在新工单中引用
屏蔽一个用户