Skip to content

Commit

Permalink
fix(h5): api upload abort fix #7448
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode committed Sep 22, 2020
1 parent 140e78e commit 6a756e8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/taro-h5/src/api/fileTransfer/uploadFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const createUploadTask = ({ url, filePath, fileName, formData, name, header, suc
}

xhr.onerror = e => {
clearTimeout(timeout)
error({
errMsg: `${apiName}:fail ${e.message}`
})
Expand Down Expand Up @@ -95,6 +96,7 @@ const createUploadTask = ({ url, filePath, fileName, formData, name, header, suc
* 中断任务
*/
const abort = () => {
clearTimeout(timeout)
xhr.abort()
}

Expand Down

0 comments on commit 6a756e8

Please sign in to comment.