File tree Expand file tree Collapse file tree 3 files changed +21
-11
lines changed Expand file tree Collapse file tree 3 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -391,12 +391,17 @@ function QiniuJsSDK() {
391
391
var aDay = 24 * 60 * 60 * 1000 ; // milliseconds
392
392
if ( now - before < aDay ) {
393
393
if ( localFileInfo . percent !== 100 ) {
394
- file . percent = localFileInfo . percent ;
395
- file . loaded = localFileInfo . offset ;
396
- ctx = localFileInfo . ctx ;
397
- if ( localFileInfo . offset + blockSize > file . size ) {
398
- blockSize = file . size - localFileInfo . offset ;
394
+ if ( file . size === localStorage . total ) {
395
+ file . percent = localFileInfo . percent ;
396
+ file . loaded = localFileInfo . offset ;
397
+ ctx = localFileInfo . ctx ;
398
+ if ( localFileInfo . offset + blockSize > file . size ) {
399
+ blockSize = file . size - localFileInfo . offset ;
400
+ }
401
+ } else {
402
+ localStorage . removeItem ( file . name ) ;
399
403
}
404
+
400
405
} else {
401
406
// 进度100%时,删除对应的localStorage,避免 499 bug
402
407
localStorage . removeItem ( file . name ) ;
Original file line number Diff line number Diff line change @@ -391,12 +391,17 @@ function QiniuJsSDK() {
391
391
var aDay = 24 * 60 * 60 * 1000 ; // milliseconds
392
392
if ( now - before < aDay ) {
393
393
if ( localFileInfo . percent !== 100 ) {
394
- file . percent = localFileInfo . percent ;
395
- file . loaded = localFileInfo . offset ;
396
- ctx = localFileInfo . ctx ;
397
- if ( localFileInfo . offset + blockSize > file . size ) {
398
- blockSize = file . size - localFileInfo . offset ;
394
+ if ( file . size === localStorage . total ) {
395
+ file . percent = localFileInfo . percent ;
396
+ file . loaded = localFileInfo . offset ;
397
+ ctx = localFileInfo . ctx ;
398
+ if ( localFileInfo . offset + blockSize > file . size ) {
399
+ blockSize = file . size - localFileInfo . offset ;
400
+ }
401
+ } else {
402
+ localStorage . removeItem ( file . name ) ;
399
403
}
404
+
400
405
} else {
401
406
// 进度100%时,删除对应的localStorage,避免 499 bug
402
407
localStorage . removeItem ( file . name ) ;
You can’t perform that action at this time.
0 commit comments