From ff07e9c4709445251b10822a5519a8fa95f530df Mon Sep 17 00:00:00 2001 From: v6ole Date: Mon, 13 Jul 2026 00:17:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=94=B9=E7=94=A8=20POST=20+=20axios.put=EF=BC=8C=E4=B8=8EMana?= =?UTF-8?q?gerWorkspace=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- frontend/src/views/desktop/CustomerManage.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/desktop/CustomerManage.vue b/frontend/src/views/desktop/CustomerManage.vue index 52e15db..2cf9da7 100644 --- a/frontend/src/views/desktop/CustomerManage.vue +++ b/frontend/src/views/desktop/CustomerManage.vue @@ -7,6 +7,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import { getManagerColor as mgrColorFn, getMgrTextColor, loadManagerColors } from '@/utils/managerColor' import { compressImage } from '@/utils/image' import api from '@/api/index' +import axios from 'axios' const auth = useAuthStore() const themeStore = useThemeStore() @@ -61,8 +62,8 @@ async function handleIndivPhotoUpload(event: Event) { if (form.photos.length >= 9) break try { const compressed = await compressImage(file, { maxPixels: 1920, quality: 0.8 }) - const presignRes = await api.get('/upload/presigned-url', { params: { filename: compressed.name, content_type: compressed.type || 'image/jpeg' } }) - await api.put(presignRes.data.upload_url, compressed, { headers: { 'Content-Type': compressed.type || 'image/jpeg' } }) + const presignRes = await api.post('/upload/presigned-url', null, { params: { filename: compressed.name, content_type: compressed.type || 'image/jpeg' } }) + await axios.put(presignRes.data.upload_url, compressed, { headers: { 'Content-Type': compressed.type || 'image/jpeg' } }) form.photos.push(presignRes.data.object_key) indivPhotoUrls.value[presignRes.data.object_key] = URL.createObjectURL(compressed) } catch (_) { ElMessage.error('上传失败') }