fix: profile photo upload field name mismatch ('file'→'photo'), sitemap auto-run only on CLI

This commit is contained in:
2026-05-09 13:55:22 +08:00
parent 7094e05227
commit 11d944bef2
2 changed files with 11 additions and 8 deletions
+3 -3
View File
@@ -72,7 +72,7 @@ export function ProfilePhotoUpload({ currentImage, userName, userId }: ProfilePh
setPreviewUrl(objectUrl)
const formData = new FormData()
formData.append("file", file)
formData.append("photo", file)
try {
const res = await fetch("/api/user/profile-photo", {
@@ -86,8 +86,8 @@ export function ProfilePhotoUpload({ currentImage, userName, userId }: ProfilePh
}
const data = await res.json()
if (data.imageUrl) {
setPreviewUrl(data.imageUrl)
if (data.url) {
setPreviewUrl(data.url)
cleanupTempUrl()
}
setUploadState("success")