From fae47f0d91084ad8e72ad8e428bb5654c4652af3 Mon Sep 17 00:00:00 2001 From: Bunny <1319900154@qq.com> Date: Sat, 5 Oct 2024 10:33:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=A7=A9=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=B8=8A=E4=BC=A0=E5=A4=B4=E5=83=8F=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/adminUser/utils/hooks.tsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/views/system/adminUser/utils/hooks.tsx b/src/views/system/adminUser/utils/hooks.tsx index 173f812..1cb701c 100644 --- a/src/views/system/adminUser/utils/hooks.tsx +++ b/src/views/system/adminUser/utils/hooks.tsx @@ -11,7 +11,6 @@ import ResetPasswordDialog from '@/views/system/adminUser/reset-passwords.vue'; import { deviceDetection } from '@pureadmin/utils'; import CropperPreview from '@/components/CropperPreview'; import AssignUserToRole from '@/views/system/adminUser/assign-user-to-role.vue'; -import { fetchUploadFile } from '@/api/v1/system'; import userAvatar from '@/assets/user.jpg'; import { fetchUploadAvatarByAdmin } from '@/api/v1/user'; @@ -177,14 +176,8 @@ export const onUploadAvatar = (row: any) => { }), beforeSure: async done => { // 上传头像 - const blob = avatarInfo.value.blob; - const uploadData = { file: blob, type: 'avatar' }; - let result = await fetchUploadFile(uploadData); - if (result.code !== 200) return; - - // 修改头像 - const data = { userId: row.id, avatar: result.data.filepath }; - result = await fetchUploadAvatarByAdmin(data); + const data = { userId: row.id, avatar: avatarInfo.value.blob }; + const result = await fetchUploadAvatarByAdmin(data); if (result.code !== 200) return; message(result.message, { type: 'success' });