Skip to content

Commit 1fe0652

Browse files
committed
try to fix 499 bug by removing localstorage after upload failed
1 parent 24e18fb commit 1fe0652

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

demo/js/qiniu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,10 @@ function QiniuJsSDK() {
589589
ajax.setRequestHeader('Authorization', 'UpToken ' + that.token);
590590
ajax.onreadystatechange = function() {
591591
if (ajax.readyState === 4) {
592+
localStorage.removeItem(file.name);
592593
if (ajax.status === 200) {
593594
var info = ajax.responseText;
594595
last_step(up, file, info);
595-
localStorage.removeItem(file.name);
596596
} else {
597597
uploader.trigger('Error', {
598598
status: ajax.status,

src/qiniu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,10 @@ function QiniuJsSDK() {
589589
ajax.setRequestHeader('Authorization', 'UpToken ' + that.token);
590590
ajax.onreadystatechange = function() {
591591
if (ajax.readyState === 4) {
592+
localStorage.removeItem(file.name);
592593
if (ajax.status === 200) {
593594
var info = ajax.responseText;
594595
last_step(up, file, info);
595-
localStorage.removeItem(file.name);
596596
} else {
597597
uploader.trigger('Error', {
598598
status: ajax.status,

0 commit comments

Comments
 (0)