@@ -14,7 +14,6 @@ import {
1414 request ,
1515 computeMd5 ,
1616 getUploadUrl ,
17- isAndroidBrowser ,
1817 filterParams
1918} from "./utils" ;
2019
@@ -57,7 +56,6 @@ export class UploadManager {
5756 this . onError = ( ) => { } ;
5857 this . onComplete = ( ) => { } ;
5958 this . retryCount = 0 ;
60- this . isAndroidBrowser = isAndroidBrowser ( ) ;
6159 Object . assign ( this , handlers ) ;
6260 }
6361
@@ -190,7 +188,7 @@ export class UploadManager {
190188 removeLocalFileInfo ( this . file ) ;
191189 return ;
192190 }
193- setLocalFileInfo ( this . file , this . ctxList ) ;
191+ setLocalFileInfo ( this . file , this . ctxList ) ;
194192 }
195193 ) ;
196194 return result ;
@@ -233,17 +231,13 @@ export class UploadManager {
233231 onProgress,
234232 onCreate
235233 } ) . then ( response => {
236- if ( this . isAndroidBrowser ) {
237- // 对于低版本安卓浏览器,因为无法触发 xhr 的 progress 事件,这里 fake 下
238- onProgress ( { loaded : chunk . size } ) ;
239- }
234+ onProgress ( { loaded : chunk . size } ) ;
240235 this . ctxList [ index ] = {
241236 time : new Date ( ) . getTime ( ) ,
242237 ctx : response . data . ctx ,
243238 size : chunk . size ,
244239 md5 : md5
245240 } ;
246- console . log ( this . ctxList ) ;
247241 } ) ;
248242 } ) ;
249243 }
@@ -281,7 +275,7 @@ export class UploadManager {
281275
282276 finishDirectProgress ( ) {
283277 // 对于低版本安卓浏览器,progress 为 null, 这里 fake 下
284- if ( this . isAndroidBrowser ) {
278+ if ( ! this . progress ) {
285279 this . progress = { total : this . getProgressInfoItem ( this . file . size , this . file . size ) } ;
286280 this . onData ( this . progress ) ;
287281 return ;
0 commit comments