arco-design / arco-design-pro-vue

An out-of-the-box solution to quickly build enterprise-level applications based on Arco Design.
https://pro.arco.design
MIT License
1.4k stars 286 forks source link

upload 组件 axios自定义请求,进度条配置会导致无法发起请求 #395

Open 501956430 opened 2 months ago

501956430 commented 2 months ago

Basic Info

axios.post('/upload',formData, {
      headers: { 'Content-Type': 'multipart/form-data' },
      withCredentials: true,
      onUploadProgress: (progressEvent) => {
        console.log(progressEvent);
        const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
        onProgress(percentCompleted, progressEvent);
      },
    })
      .then((res) => {
        onSuccess('上传成功');
        console.log(res);
      })
      .catch((err) => {
        onError('上传失败');
      });

添加了onUploadProgress 请求就不执行。

501956430 commented 1 month ago

有没哪位大侠可以帮帮我