From 39f1ad026cfc6faede09793dccb166ceeef7b1b6 Mon Sep 17 00:00:00 2001 From: liaozetao <1107136310@qq.com> Date: Tue, 9 Jan 2024 15:47:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/common/upload.js | 5 +- src/views/users/GiftManageView.vue | 178 ++++++++++++----------------- 2 files changed, 77 insertions(+), 106 deletions(-) diff --git a/src/api/common/upload.js b/src/api/common/upload.js index 2611be0..69de05b 100644 --- a/src/api/common/upload.js +++ b/src/api/common/upload.js @@ -23,9 +23,10 @@ export const uploadFile = id => { }); }; -export const uploadGift = (id) => { +export const uploadGift = (file) => { let formData = new FormData(); - formData.append('file', $(id)[0].files[0]); + console.log(file); + formData.append('file', file); return new Promise((resolve, reject) => { request.post('/admin/gift/upload', formData).then(res => { resolve(res); diff --git a/src/views/users/GiftManageView.vue b/src/views/users/GiftManageView.vue index dfc6c91..d83d8b1 100644 --- a/src/views/users/GiftManageView.vue +++ b/src/views/users/GiftManageView.vue @@ -288,7 +288,7 @@
- + @@ -551,10 +551,16 @@