Skip to content

Commit 5511672

Browse files
authored
fix(uploader): xhrBeforeUpload判断错误 (#2507)
1 parent 40daef4 commit 5511672

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/packages/uploader/upload.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,12 @@ export class UploaderTaro extends Upload {
8888

8989
uploadTaro(uploadFile: any, env: string) {
9090
const options = this.options
91+
if (options.beforeXhrUpload) {
92+
options.beforeXhrUpload(uploadFile, options)
93+
return
94+
}
9195
if (env === 'WEB') {
9296
this.upload()
93-
} else if (options.beforeXhrUpload) {
94-
options.beforeXhrUpload(uploadFile, options)
9597
} else {
9698
const uploadTask = uploadFile({
9799
url: options.url,

0 commit comments

Comments
 (0)