Skip to content

Commit

Permalink
fix: download and upload progress inverted fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
JOU-amjs committed Apr 26, 2024
1 parent d2533a1 commit 7caa74a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"@types/jest": "^29.4.0",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"alova": "^2.16.2",
"alova": "^2.19.2",
"axios": "^1.3.4",
"babel-jest": "^29.2.2",
"commitizen": "^4.3.0",
Expand Down
4 changes: 2 additions & 2 deletions src/requestAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export default function requestAdapter(options: AdapterCreateOptions = {}) {
onUploadProgress:
process.env.NODE_ENV !== 'test'
? event => {
uploadHandler(event.loaded, event.total || 1);
uploadHandler(event.total || 1, event.loaded);
}
: undefinedValue,
// `onDownloadProgress` 允许为下载处理进度事件
onDownloadProgress: event => {
downloadHandler(event.loaded, event.total || 1);
downloadHandler(event.total || 1, event.loaded);
},
...config
});
Expand Down

0 comments on commit 7caa74a

Please sign in to comment.