From 774969c327cdc2a0cbbc2bbaf51d8f878972e8e6 Mon Sep 17 00:00:00 2001 From: colorfulberry Date: Mon, 8 Jun 2020 19:57:45 +0800 Subject: [PATCH] feat: update the js --- web_src/js/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web_src/js/index.js b/web_src/js/index.js index 4169a61d8..1c2ab7b2c 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -2409,8 +2409,11 @@ $(document).ready(async () => { timeout: 18000000, previewTemplate, init() { - this.on('sending', (_file, _xhr, formData) => { - formData.append('dataset_id', $dataset.data('dataset-id')); + this.on('sending', (file, xhr, _formData) => { + const send = xhr.send; + xhr.send = function () { + send.call(xhr, file); + }; }); this.on('success', (file, _data) => { const uuid = $dataset.data('uuid');